Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-08-2006, 01:06 AM   PM User | #1
SHY
New Coder

 
Join Date: Apr 2005
Location: Kosice, Slovakia
Posts: 36
Thanks: 2
Thanked 0 Times in 0 Posts
SHY is an unknown quantity at this point
php safe_mode and uploading

is it possible to upload files via http into directories created by php while in safe_mode?
cause ive made a webpage where admin creates a fotoalbum and an appropriate directory is created by php where all the album photos should be stored.
the problem is that as soon as i try to upload a photo into this directory, move_uploaded_file returns error such as "script whose uid is 1000 cannot access /dir/dir/dir whose uid is 33.." which is weird as that /dir/dir/dir has been created by the same script couple of second before.
when i try to upload files into directories created manually, it works fine.
any ideas how to solve this?
thanks in advance.
__________________
"Programming is an art form that fights back."
SHY is offline   Reply With Quote
Old 05-08-2006, 05:14 AM   PM User | #2
dniwebdesign
Regular Coder

 
dniwebdesign's Avatar
 
Join Date: Dec 2003
Location: Carrot River, Saskatchewan
Posts: 838
Thanks: 15
Thanked 9 Times in 9 Posts
dniwebdesign is an unknown quantity at this point
Yes, it is possible to upload via a webpage in safe mode. Make sure the directory you are uploading too is chmod to 777.
__________________
Dawson Irvine
CEO - DNI Web Design
http://www.dniwebdesign.com
dniwebdesign is offline   Reply With Quote
Old 05-08-2006, 12:18 PM   PM User | #3
harsh789
New Coder

 
Join Date: May 2006
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
harsh789 is an unknown quantity at this point
You can also use copy instead of move_uploaded_file.
harsh789 is offline   Reply With Quote
Old 06-06-2006, 09:07 AM   PM User | #4
looka
Regular Coder

 
Join Date: Aug 2004
Posts: 280
Thanks: 0
Thanked 0 Times in 0 Posts
looka is an unknown quantity at this point
copy or move_uploaded_file does not have affect on safe_mode restrictions.

use move_uploaded_file, because it do some security checks.
looka is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:50 AM.


Advertisement
Log in to turn off these ads.