RTS Posted December 31, 2006 Share Posted December 31, 2006 So I have a simple PHP upload form ( The code below ), that uploads to a folder called files. The problem is that every file that is uploaded doesn't work any more when uploaded in files. How can I fix this?[code]<?PHP$target_path = "files/";$target_path = $target_path . basename( $_FILES['Filedata']['name']); if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['Filedata']['name']). " has been uploaded";} else{ echo "There was an error uploading the file, please try again!";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/ Share on other sites More sharing options...
fert Posted December 31, 2006 Share Posted December 31, 2006 are you sure the form has the enctype="multipart/form-data" attribute? Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150447 Share on other sites More sharing options...
RTS Posted December 31, 2006 Author Share Posted December 31, 2006 yea, it does Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150454 Share on other sites More sharing options...
PFMaBiSmAd Posted December 31, 2006 Share Posted December 31, 2006 This is probably a permissions problem with the folder. What type of files are these and what exactly do you mean - [quote]every file that is uploaded doesn't work any more[/quote] Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150461 Share on other sites More sharing options...
RTS Posted December 31, 2006 Author Share Posted December 31, 2006 I have chmoded the folder to 777, and the files that I have tried uploading are swf, and avi files as these are the types my site will be working with. Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150477 Share on other sites More sharing options...
Nicklas Posted December 31, 2006 Share Posted December 31, 2006 correct me if i'm wrong, but if I remember correctly, the maximum allowed filesize is 2Mb. If your files go beond that, they wont be uploaded unless you edit your php.ini to allow bigger filesizes. Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150480 Share on other sites More sharing options...
RTS Posted December 31, 2006 Author Share Posted December 31, 2006 they are smaller thann 2mb tho like 500 kb Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150495 Share on other sites More sharing options...
Flava Posted December 31, 2006 Share Posted December 31, 2006 Not a problem with your variables is it?On an old web server of mine I had to request the file names and such using$filedata = $_REQUEST['filedata'];.etcBut if your variables are fine then I'm not sure what the problem may be. Link to comment https://forums.phpfreaks.com/topic/32392-upload-form-loses-data/#findComment-150520 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.