Jump to content

Some photos won't move to directory..


jwk811

Recommended Posts

$pic = $_FILES['photo'];

	$ext = substr(strrchr($pic['name'], "."), 1); 
	$imagePath = md5(rand() * time()) . ".$ext";

$target = "images/";
$target = $target . $imagePath;


move_uploaded_file($pic['tmp_name'], $target);

 

 

It works for me and I don't think it's the extension because it's always .jpg and it works for me. I just don't get what could be happening. It worked before perfectly until I changed things around but it's still the SAME! And the directory has just the same permissions as the last one when it worked.

Link to comment
https://forums.phpfreaks.com/topic/197547-some-photos-wont-move-to-directory/
Share on other sites

http://www.phpfreaks.com/forums/index.php/topic,292945.msg1386624.html#msg1386624

 

The code at that link will check for and display upload errors. At the point where it has a the comment // put any type, size, file name/extension, or content validation here, you can put in any of the application level validation you need before you use move_uploaded_file() or put some of the uploaded file information into a database query statement.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.