Page 1 of 1

How to use SABnzbd Add by fileupload / addFile API call

Posted: April 6th, 2013, 2:02 pm
by noice
Just because I lost some time getting to know how SABnzbd "Add by fileupload" aka "addfile" works, I though it would be good to share this simple HTML script to help API users understand how this works.
The manual is unfortunately silent on this topic: http://wiki.sabnzbd.org/api#toc29

Purpose: Add by fileupload/addfile API action takes a file content in argument and download this file in SABnzbd.

Example:

Code: Select all

<form action="https://127.0.0.1:8080/sabnzbd/api" method="POST" enctype="multipart/form-data">
Mode: <input type=text name="mode" value="addfile">
Filename: <input type=text name="nzbname" value="my target folder name">
File to upload: <input type=file name="nzbfile"><br>
<!--<input type=text name="cat" value="movies"><br>-->
API key: <input type=text name="apikey" value="my api key"><br>
<input type=submit>
</form>
Note that the form must use enctype="multipart/form-data" to properly send files.

Useful links:
SABnzbd API source code: https://github.com/sabnzbd/sabnzbd/blob ... zbd/api.py