Jump to content

Recommended Posts

Hey people

Happy New Year to you all.

I have a question

I have a form, with a file field
<input type='file' name='x_file' />

The form is validated

If they forget something, then the form is reloaded, all text fields are filled in using $_POST
BUT
You can not give $_FILES a value

So I thought I would store the data for $_FILES into a variable, and parse in the form
All the data got parsed across no problems,
BUT
now
the tmp_name does not exists, as the file has been deleted.

Any suggestions on how to make the tmp_name last a bit longer (temp uploaded image)
or another way of doing this

I dont really want to upload the image till they have completed the form
Link to comment
https://forums.phpfreaks.com/topic/32589-question-re-_files/
Share on other sites

Thanks, I will have a little think
Using Sessions or cookies will not work, as the tmp upload image only last a short period of time, which is what is causing the error.
I did originaly have the file upload seperate, but my boss did not like that idea
I am seeing him tomorrow, I will have a word.

Cheers guys

Link to comment
https://forums.phpfreaks.com/topic/32589-question-re-_files/#findComment-151789
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.