|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-10-28 09:33 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 11:00:01 2025 UTC |
Description: ------------ upload photo with the name {1E0557DF-2797-4E31-9908-81722ABCED19}0.jpg It won't work, rename it to xxxxx.jpg, It works. Here is the code I used: $uploadFileWithoutPath = "photos".basename($_FILES['PhotoUpload']['name']); $uploadFileWithoutPath = urlencode($uploadFileWithoutPath); $uploaddir = $PhotoDir; $uploadfile = $uploaddir . $uploadFileWithoutPath; $uploadfile = sprintf($uploadfile,time()); $requestValid = true; $fileSize = $_FILES['PhotoUpload']['size']; if($fileSize > 1000000) { $requestValid = false; } if (move_uploaded_file($_FILES['PhotoUpload']['tmp_name'], $uploadfile)) { //do my stuff here....... Reproduce code: --------------- http://lab.mytalentexchange.com/ Click a location, and click "add marker" link, try to upload a photo with the name {1E0557DF-2797-4E31-9908-81722ABCED19}0.jpg It won't upload the photo, now rename it to xxxxx.jpg, It works.