General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

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:
  #1  
Old March 30th, 2004, 10:03 AM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
Unhappy Safe mode ?! =O

Hi... wtf is safemode ?... i get the folowing error while uploading...

Warning: copy(): SAFE MODE Restriction in effect. The script whose uid is 33550 is not allowed to access /tmp owned by uid 0 in /customers/sickworld.org/sickworld.org/httpd.www/kampp/tb/upload_tegning.php on line 22

the code for the script is following:

PHP Code:
if ($myfile && $navn && $besk) {

    
$file_type=$_FILES['myfile']['type']; 
    
$file_upload=$_FILES['myfile']['tmp_name']; 
    
$file_error=$_FILES['myfile']['error']; 

    if (
is_uploaded_file($_FILES['myfile']['tmp_name'])) {

    
$new_name rename($_FILES['myfile']['tmp_name'],"hej.jpg");

    
$dest 'uploads/tegninger/$USERID/$new_name';
            
    
copy($_FILES['file']['tmp_name'], $dest); 


where line # 22 is the copy() line

Reply With Quote
  #2  
Old March 30th, 2004, 01:30 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Safe mode is a setting in php.ini that can be turned on to prevent people from doing potentially dangerous things like uploading files. Look for safe_mode in your php.ini, turn it off, and restart apache.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old March 30th, 2004, 03:18 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
hmmm... i had suspected that. The problem is, that im running a remote server, (b-one) and how do i acces it there. ??

Reply With Quote
  #4  
Old March 30th, 2004, 04:16 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
See if you can contact one of the admins on the site that is hosting your page and see if they can turn it off for you, or, if you have shell/telnet access you can change the file yourself within your shell, as long as the php.ini file is in a folder that you have access to and as long as you have the correct permissions for changing the file

Reply With Quote
  #5  
Old March 30th, 2004, 04:27 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
Unhappy

thnx...

now here the really wierd thing... i define the upload like this:

PHP Code:
 $new_name rename($_FILES['myfile']['tmp_name'],"$USERID.jpg");

    
$dest 'uploads/tegninger/$USERID/$new_name';
            
    
copy($_FILES['file']['tmp_name'], $dest); 


so... i still get the safemode error. But the file is none-the-less uploaded, but to the rootfolder of the site. is there something wrong with the $dest defination ?

- Pheifel

Reply With Quote
  #6  
Old March 31st, 2004, 05:09 AM
wAr-AnGeL wAr-AnGeL is offline
Forum Security
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Behind You
Posts: 479 wAr-AnGeL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 50 sec
Reputation Power: 7
Send a message via ICQ to wAr-AnGeL Send a message via AIM to wAr-AnGeL
Are the directories for /$USERID/$new_name already created before uploading? I think they need to be created prior to uploading anything into them
__________________




"Only Linux users see the end of crashes."
- Pl4t0

Reply With Quote
  #7  
Old March 31st, 2004, 05:02 PM
Pheifel Pheifel is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Denmark
Posts: 174 Pheifel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 46 sec
Reputation Power: 5
Send a message via MSN to Pheifel
Wwweeeiii

i got the problem solved the problem is, that under safemode, the "rename()" cant be used. But you can just rename the file in the copy() under the destination...

thanx for the help

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Safe mode ?! =O


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 5 hosted by Hostway
Stay green...Green IT