Last modified: 2009-10-20 21:59:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23210, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21210 - Upload API error message
Upload API error message
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.16.x
All All
: Normal normal (vote)
: ---
Assigned To: Michael Dale
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-20 21:34 UTC by Russell Blau
Modified: 2009-10-20 21:59 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Russell Blau 2009-10-20 21:34:26 UTC
I sent a POST request to https://secure.wikimedia.org/wikipedia/en/w/api.php with the following (relevant) message headers and body; the ****'s indicate where I have obscured or omitted content that shouldn't affect this issue:

Content-Type: multipart/form-data
boundary="===============0637518620=="
MIME-Version: 1.0

--===============0637518620==
Content-Type: text/plain
MIME-Version: 1.0
Content-disposition: form-data; name="maxlag"

5
--===============0637518620==
Content-Type: text/plain
MIME-Version: 1.0
Content-disposition: form-data; name="format"

json
--===============0637518620==
Content-Type: text/plain
MIME-Version: 1.0
Content-disposition: form-data; name="filename"

Testpage1.gif
--===============0637518620==
Content-Type: text/plain
MIME-Version: 1.0
Content-disposition: form-data; name="token"

6e09************************e48a+\
--===============0637518620==
Content-Type: image/gif
MIME-Version: 1.0
Content-disposition: form-data; name="file"

GIF89a2****  lots of 16-bit data deleted  ****;
--===============0637518620==
Content-Type: text/plain
MIME-Version: 1.0
Content-disposition: form-data; name="action"

upload
--===============0637518620==--

The API returned the error message:

{"error":
    {"code": "missingparam",
     "info": "One of the parameters sessionkey, file, url, enablechunks is required"
    }
}

The parameter "file" actually was present in the input, so the error message is inexplicable.  Clearly, something is wrong but I cannot tell whether it is in the server or the client.
Comment 1 Bryan Tong Minh 2009-10-20 21:59:56 UTC
You're file content-disposition is wrong; it should be like this:

'Content-Disposition: form-data; name="%s"; filename="%s"\r\n'

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links