|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I have gotten this script to upload a File from my WebHost I made a directory "incoming" and made it chmod 777, but when I want to upload I always get this Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 32084 is not allowed to access / owned by uid 0 in /mnt/storage2/u/ul/ulla.nl/html/uploadFile.php on line 8
could not store /incoming//1141kl.jpg I followed many tutorials, but still don't know what I have to write after move_ulpoaded_file. I would appreciate it very much if someone can help me out of this. How can I handle this SAFE MODE? Thankxxx. <?php $ThisFileName = basename(_FILE_); // get the file name $path = str_replace($ThisFileName,"",_FILE_); // get the directory path $upload_dir = "$path/incoming/"; // be shure php has access to this dir (chmod) $new_file = $upload_dir."/".$_FILES['userfile']['name']; if ($_POST['upload'] == "Upload"){ if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { move_uploaded_file($_FILES['userfile']['tmp_name'], $new_file) or print "could not store $new_file "; } else { switch ($_FILES['userfile']['error']) { case 0: print "!is_uploaded_file.., no file upload? "; break; case 1: print "Error: file size to big; size limit set by php.ini "; break; case 2: print "Error: file size to big; size limit set by MAX_FILE_SIZE "; break; case 3: print "Error: file is partially uploaded "; break; case 4: print "Error: no file is uploaded "; break; default: print "Error: unknown "; } } } ?> <body> <form enctype="multipart/form-data" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> Upload foto kl: <input name="userfile" type="file"> <input type="submit" name="upload" value="Upload"> </form> |
|
#2
|
|||
|
|||
|
Quote:
safe mode here needs to be relaxed. You will have to contact whereever you host your script to have it relaxed before it works. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > move uploaded file problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|