Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/245021-image-upload-script-error/
Share on other sites

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:

 

114127.png

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.