Code: Select all
my $req = POST $url."api?mode=addfile&ma_username=".$username."&ma_password=".$password."&name=".$filename, Content_Type => 'form-data', Content => [$filename=>[$location."/".$filename]];Code: Select all
<h2>500 Internal error</h2>
<p>The server encountered an unexpected condition which prevented it from fulfilling the request.</p>
<pre id="traceback">Traceback (most recent call last):
File "/usr/src/tar.gz/SABnzbd-0.4.2/cherrypy/_cphttptools.py", line 126, in _run
applyFilters('before_finalize')
File "/usr/src/tar.gz/SABnzbd-0.4.2/cherrypy/filters/__init__.py", line 151, in applyFilters
method()
File "/usr/src/tar.gz/SABnzbd-0.4.2/sabnzbd/utils/multiauth/filter.py", line 61, in beforeFinalize
**rsrc.callable_kwargs)
TypeError: api() got an unexpected keyword argument 'file.nzb'
</pre>
<div id="powered_by">
<span>Powered by <a href="http://www.cherrypy.org">CherryPy 2.3.0</a></span>
</div>(Oh, and for the non-perl people, or the people who are to lazy to figure out what URL I am using
http://server:7777/sabnzbd/api?mode=add ... e=file.nzb.
And together with this, it'll post a file with the name file.nzb. If I run php with a print_r over the $_FILES array, I get this:
Code: Select all
[file_nzb] => Array
(
[name] => file.nzb
[type] => text/plain
[tmp_name] => /tmp/phpzLa6F1
[error] => 0
[size] => 217853
)

