Jump to content

move photo to directory not working


jwk811

Recommended Posts

most of the time it works but then a few people couldnt get their photos to upload. im stumped. i think it has something to do with the extension in capital letters instead. but i tried a photo like that and it worked fine. ahhh help please

 

$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);

Link to comment
https://forums.phpfreaks.com/topic/197490-move-photo-to-directory-not-working/
Share on other sites

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.