Jump to content

Passing upload image location to another form that uploads


redbrad0

Recommended Posts

This isnt really a question on how to upload a image to the server but more how I can let the user select a file to upload and pass the location that the user wants to upload the image from to another page. This other page will allow them to fill out some additional information and then when they click submit, at that time it will upload the image to the server.

 

I was thinking I might be able to pass the value thru a hidden input field, but I can't seem to get it to work. Is this even a possibility?

The answer is NO.

 

The type="file" input field can only be set by the browser's file selection dialog box, so there is no way that you can set the value="..." for it either in the html or using javascript. The file is also uploaded on the form submission where the type="file" has been selected and unless that form processing code does something with the temporary uploaded file, it is destroyed when the resources used on that page are released when the page ends execution.

So if I store the _FILES into a array like suggested, then I can handle this? But doesn't that mean that the files will be uploaded to the server?

 

I could just make the image upload the last part of the "wizard" but I would rather keep it where it is. So any suggestions on the way to handle this would be great.

The form processing code where the uploaded file is submitted to would need to process the uploaded file - check for upload errors and if none, read the temporary uploaded file into a session variable and save the type and name information from the $_FILES array in other session variables.

Archived

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

×
×
  • 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.