iMattR Posted August 17, 2011 Share Posted August 17, 2011 Hello, all. The company I work for have a custom property search script that was developed around 8 months ago by a previous developer, and I've only joined in the past few weeks. But either way, the script is a property search script which has a back-end that enables users to add, remove and amend properties. This also includes image uploading. However, more recently, the client hasn't been able to upload images to any newly created properties - however, any older properties allow image upload, whereas the new created ones, or amendment of recently created ones, causes an error. This is very strange, and I can't see any problems whatsoever, and the permissions on the directories lookf ine. Any help with this would be brilliant, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/245021-image-upload-script-error/ Share on other sites More sharing options...
AyKay47 Posted August 17, 2011 Share Posted August 17, 2011 can you post the relevant code..? Quote Link to comment https://forums.phpfreaks.com/topic/245021-image-upload-script-error/#findComment-1258547 Share on other sites More sharing options...
iMattR Posted August 17, 2011 Author Share Posted August 17, 2011 Unfortunately, the place I'm working at only allows me to post limited amounts: while(list($key,$value) = each($_FILES[pdf][name])) { $pdf = $_FILES[pdf][name][0]; if(!empty($value)){ // this will check if any blank field is entered $filename = $value; // filename stores the value $filename=str_replace(" ","_",$filename);// Add _ inplace of blank space in file name, you can remove this line $add = "$root"."/$siteroot/$imagesfolder/$pid/pdf/$filename"; // upload directory path is set if (@copy($_FILES[pdf][tmp_name][$key], $add)) {// upload the file to the server if (@chmod("$add",0777)) { echo "<div style=\"background-color:#ffa; padding:20px\"><p>".$_FILES[pdf][name][$key]; // uncomment this line if you want to display the file type echo " uploaded</p></div><br>"; } else { die("<div style=\"background-color:#ff0000; padding:20px\"><p>Error with permissions, files not uploaded</p></div>"); } } else { echo "<div style=\"background-color:#ff0000; padding:20px\"><p>Error uploading files to:-"; echo $add . "</p></div>"; die(); } } } And here's the error that we're getting: Quote Link to comment https://forums.phpfreaks.com/topic/245021-image-upload-script-error/#findComment-1258558 Share on other sites More sharing options...
AyKay47 Posted August 17, 2011 Share Posted August 17, 2011 remove the error supressors.. " @ " for the copy function and chmod function.. then let me know what errors are being sent to the error.log Quote Link to comment https://forums.phpfreaks.com/topic/245021-image-upload-script-error/#findComment-1258581 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.