Hello everybody!

I want to implement an extension that offers a different way for uploading 
files to a MediaWiki file repo. In my extensions code I receive file data in 
form of a PHP 'resource' (not through $_FILE or similar). I want to add this 
file data to the (local) file repo, so that it shows up in the "File" 
namespace. Unfortunately all UploadBase derived classes are bound to 
WebRequestUpload and I would have to construct such an object, which is pretty 
difficult. As an alternative I could use the Upload API [1]. But I don't know 
how to mimic the "multipart/form-data" content type when calling the API 
internally [2]. This already was part of a request on the talk page of the 
Upload API [3].

So is there any recommended way to upload a file using PHP (in extension 
context) without having a WebRequestUpload ($_FILES)?

[1] https://www.mediawiki.org/wiki/API:Upload
[2] https://www.mediawiki.org/wiki/API:Calling_internally
[3] 
https://www.mediawiki.org/wiki/API_talk:Upload#REAL_WORLD_EXAMPLES_.3F.3F.3F 
("What about an example for calling the api internally(like edit)" by 
Nischayn22)

Thanks in advance,

Robert Vogel
Softwareentwicklung

[Industriepreis]<http://www.blue-spice.org/de/loesungen/packages/bluespice-docu>

Hallo Welt! - Medienwerkstatt GmbH
Residenzstraße 2
93047 Regensburg

Tel.  +49 (0) 941 - 66 0 80-198
Fax   +49 (0) 941 - 66 0 80-189

www.hallowelt.biz<http://www.hallowelt.biz/>
[email protected]<mailto:[email protected]>


Sitz: Regensburg
Amtsgericht: Regensburg
Handelsregister: HRB 10467
E.USt.Nr.: DE 253050833
Geschäftsführer: Anja Ebersbach, Markus Glaser, Dr. Richard Heigl, Radovan 
Kubani

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to