On 07/12/12 16:05, dan wrote:
> hey all,
> 
> i’m working on an extension that will depend on the upload of xml and csv 
> data files. i need some advice on how to best upload those data file types 
> and then process them. any guidance on how to do this within the mediawiki 
> framework would be greatly appreciated. the end goal is that the extension 
> will run within http://commons.wikimedia.org.
> 
> here are some initial thoughts/questions :
> 
> 1. i’ve been looking at how SpecialUpload.php and UploadBase.php work 
> together, but found that i need to override $wgMimieTypeBlacklist’s value of 
> 'text/html' and make sure $wgDisableUploadScriptChecks is set to true in 
> order for UploadBase.php to accept an xml file and i’m still figuring out 
> what needs to be overridden or adjusted in order to accept a csv file.
> 
>    a. is this the recommended path to being able to upload these file types?
>       i. if so, is there a manual that guides one through how to implement 
> this?
>       ii. if not, what is the recommended path?

The problem with overriding the blacklist is that some evil users could
upload html, which then runs javascript and hijacks the user accounts.

If your xml is different enough than html, it should be possible to
detect them with their type, instead of skipping the html blacklist.



> 2. the idea for the form is that after selecting the file, pressing the 
> submit button would asynchronously upload the data file.
>    a. how can this best be accomplished?
>    b. any current documentation on how to do this besides code itself?

Just use the normal upload process, such as the UploadWizard ?


> 3. the files would then be stored and versioned.
>    a. what is the best way to then store those file types for versioning?

The wiki automatically versions the files.


> 4. then a batch process id would be created and have a logging process that 
> would allow the original uploader to view the progress of working on the 
> uploaded data.
>    a. how can this best be accomplished?
>    b. any current documentation on how to do this besides code itself?

Some special page, perhaps. I think there may be something similar with
videos, where a job is created to transcode them, but I don't think
there's an interface to view the process of working on that. You will
have to create your own SpecialPage.



_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to