luminous Posted September 6, 2010 Share Posted September 6, 2010 Just a question concerning the $_FILES['tmp_name'] field. I'm uploading a file which is being moved into two different locations. I run an 'If' check to see if either process fails but as I am running them both at the same time, when a $_FILES['tmp_name'] is moved, can it be used again? Both my functions run fine independetly but when I try run them both it doesn't work So my question is which may be seem fairly obvious: Once you move the $_FILES['tmp_name'] is it removed from the temp folder it's in? or is it copied? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/212648-_filestmp_name-recycling/ Share on other sites More sharing options...
Adam Posted September 6, 2010 Share Posted September 6, 2010 How are you moving/copying the file? Quote Link to comment https://forums.phpfreaks.com/topic/212648-_filestmp_name-recycling/#findComment-1107777 Share on other sites More sharing options...
luminous Posted September 6, 2010 Author Share Posted September 6, 2010 Sorry, Should of mentioned that! I'm using the 'move_uploaded_file' function in both instances. Quote Link to comment https://forums.phpfreaks.com/topic/212648-_filestmp_name-recycling/#findComment-1107783 Share on other sites More sharing options...
Adam Posted September 6, 2010 Share Posted September 6, 2010 Then yeah, the temp file will be removed. You can get around it though by copying the file yourself with copy. Quote Link to comment https://forums.phpfreaks.com/topic/212648-_filestmp_name-recycling/#findComment-1107786 Share on other sites More sharing options...
luminous Posted September 6, 2010 Author Share Posted September 6, 2010 Cheers, Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/212648-_filestmp_name-recycling/#findComment-1107787 Share on other sites More sharing options...
Adam Posted September 6, 2010 Share Posted September 6, 2010 No problem; just remember to unlink the temp file once you're done with it. Quote Link to comment https://forums.phpfreaks.com/topic/212648-_filestmp_name-recycling/#findComment-1107788 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.