Jump to content

Want to automatically upload a file


nahidshahin

Recommended Posts

Dear great PHP programmers,

Wish you Happy Easter.

 

I am working with MediaWiki which is developed in PHP.

I need to process some given input text and come up with a XML file which is upload-able in semantic MediaWiki using their given interface 'Special:Import'. User just press "insert" button and want to see the output page return by 'Special:Import' module.

 

So my idea was to make same <form enctype='multipart/form-data'> element that 'Special:Import' use to submit the xml file.

 

What I did is,

Click Insert button From WIKI-> goto processAndUploadXML.php (outside WIKI) -> create XML ->

create a HTML with <body onLoad="document.forms[0].submit();">... (go back to WIKI) so that user can't see the page

Here I try to set upload-able file name using javascript when submitting the Form, some thing like file_dom.value = "$_SERVER['DOCUMENT_ROOT']./WikiTaskList.xml"

 

But i'ts not working. My firebug (Firefox extention) gives "Security error code: 1000" error.

And 'Special:Import' says no file found.

 

Can any one suggest me what can I do? May be one idea is to create HTTP request by my hand using some "packet sniffer". But it may complex thing. (I don't have any idea about HTTP request creating what browser do for me )

 

Please Anyone share your idea.

Sorry for boring details I explained here.

Advance thanks

-Nahid

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.