file input type being used to select a file and then move the data to a form with the approperiate file input tag
I have an iframe which will have an input tag that allows you to browse for the file you are wanting to upload.
What i was then doing was creating a new input type = "file" tag in my hidden form data which would be populated with the src of the file.
At the end of everything there is a button the users can use to submit the actual form.
The submitted form, will have the file, but it would be empty. I was thinking there might be some underlying event going on that i didnt know about. When reading up on it, i also had noticed that if the source is wrong, it will just send an empty file.
How is this done correct?
Update: When looking at the data,the dom element input:file has an attribute called files which is the attribute i want to move to the new item. My fiddle is: http://jsfiddle.net/4vNXv/
I cant seem to get new data to move over from the old input to the new input.
Edit: I was thinking that jQuery might be able to maintain data by copying the whole object. via the $(this).clone() command, but that was not working either.
Editing the file form field is a security risk and thus is disabled on most browsers.
In your scenario, I believe you could create two forms (one in the iframe) and submit both on the button request.