Hey,
I have an extension that transfers content, including images, from one wiki
to another via the API. Currently it's using the upload via url option [0],
which works great, but not obviously not for source wikis that can not be
accessed from where the target wiki is. For that I need to use the regular
file transfer, but can't find what to do here.
The documentation states very helpful "When uploading files directly, the
request must use multipart/form-data as Content-Type or enctype,
application/x-www-form-urlencoded will not work.", but then provides no clue
at how to actually set the content type when making a request via the
MWHttpRequest class. I tried several things after looking at the source, but
could not get it working. Also am not finding any existing code doing this.
Any pointers here would be greatly appreciated :)
[0]
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/API:Upload#Uploading_…
Cheers
--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil.
--