Jump to content


This topic is now archived and is closed to further replies.


uploading files with ajax

Recommended Posts

Im trying to use an iframe to upload files. Im copying every input fields from a real form to a form inside a hidden iframe, all fields worked fine except the files that is to be uploaded.

Below is part of my code

for (var i=0 ; i < oForm.elements.length; i++)
{ var oHidden = oIFrame.document.createElement("input");
    oHidden.type = "hidden";
    oHidden.name = oForm.elements[i].name;
    oHidden.value = oForm.elements[i].value;
oHiddenForm.encoding = "multipart/form-data"; 
oHiddenForm.action = oForm.action;


Ive tried everything i could and still couldnt get it to work. Please help.

Share this post

Link to post
Share on other sites
This is not AJAX functionality!?

Share this post

Link to post
Share on other sites
Take a look at this tutorial:

It shows how to organize the File Upload and show the progress meter in Ajax manner.
This is an online demo for this tutorial:

Yep, the demo uses Iframe also. Uploading file using the true Ajax technology is limited by the browser security. Actually, this is a way to go, but work only with FireFox:

Share this post

Link to post
Share on other sites


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.