MoMoMajor Posted July 26, 2009 Share Posted July 26, 2009 i have an image upload form that I want to clear files from to stop users from re-uploading the same image when they hit refresh. I have tried unlink, unset and everything in between and nothing works. Is there a special php command to remove all information from a certain form? Link to comment https://forums.phpfreaks.com/topic/167468-clearing-user-files/ Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 You want to remove the file from dir, so unlink will work. OR you want to clear page cache... why not show a msg after uploading by using header to redirect to successful upload page and then back to that page. just an idea. Link to comment https://forums.phpfreaks.com/topic/167468-clearing-user-files/#findComment-883045 Share on other sites More sharing options...
MoMoMajor Posted July 26, 2009 Author Share Posted July 26, 2009 You want to remove the file from dir, so unlink will work. OR you want to clear page cache... why not show a msg after uploading by using header to redirect to successful upload page and then back to that page. just an idea. i have unlink($_FILE['userfile']) but it doesn't work. Link to comment https://forums.phpfreaks.com/topic/167468-clearing-user-files/#findComment-883051 Share on other sites More sharing options...
mmarif4u Posted July 26, 2009 Share Posted July 26, 2009 Maybe the path you give to unlink the file is wrong. check that. Link to comment https://forums.phpfreaks.com/topic/167468-clearing-user-files/#findComment-883059 Share on other sites More sharing options...
MoMoMajor Posted July 26, 2009 Author Share Posted July 26, 2009 Ok I have been trying for hours and hours to stop my image upload script from uploading the same image whenever a user refreshes the page. I have tried unlink, unset and redirecting the user and back. It still won't quit. I have literally unset every single input element in my script but the form still submits the previous image when the page is refreshed. unlink just returns the following error: Warning: unlink() [function.unlink]: No error in c:\program files\.... I even tried to attach a user submitted validation to the script by making them solve a simple addition question but even this didn't work because for some reason unset didn't stop the variables from being removed. Link to comment https://forums.phpfreaks.com/topic/167468-clearing-user-files/#findComment-883102 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.