SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old July 16th, 2004, 01:06 PM
Ulitasch Ulitasch is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 7 Ulitasch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy move uploaded file problem

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>

Reply With Quote
  #2  
Old July 21st, 2004, 03:44 PM
q3utom q3utom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 16 q3utom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
move_uploaded_file(): SAFE MODE Restriction in effect.


safe mode here needs to be relaxed. You will have to contact whereever you host your script to have it relaxed before it works.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > move uploaded file problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway