22, November 2008

trouble with photo upload - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: trouble with photo upload
« previous next »
Pages: [1] Print

Author Topic: trouble with photo upload  (Read 942 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« on: Apr 08, 2006, 01:44:52 AM »

Hello,

I think I wrote a really good upload class and the class works fine on lots of servers.

On some servers I have problems with the chmod values.
The script uploads a file to location creates a 1 or 2 resized versions and finally the orig. file. so far zo good. The script creates also not existing directories with a chmod value of 0755. the files getting a value of 0644.

On some servers I need to create the upload folder with a mode 0777 otherwise ther is no permission to upload. creating the folders is not possible and resized file (GD lib.) is getting a 0666. What happens here is there something wrong on the shared host? I thought that php scripts are executed as an owner?


Last blog : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #1 on: Apr 08, 2006, 12:16:30 PM »

Well php is running as a process of httpd (apache)

So it will use the permissions of the apache user (on most installations that is the user nobody)

If this is a nix host you can try using the /tmp directory for your uploads. Propably it wont have any problem.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Apr 08, 2006, 04:07:35 PM »

The problem on this hostings is not the upload, but the chmod value i have to use for the folder where I want to copy a resized version.


Last blog : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #3 on: Apr 08, 2006, 09:19:09 PM »

Oh. Then there is no other way to make this work.

Maybe you can try the php chmod Visit through proxy command to make this a little more automated within your script, but propably your host wont allow this.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Apr 08, 2006, 09:24:34 PM »

Oh. Then there is no other way to make this work.

Maybe you can try the php chmod Visit through proxy command to make this a little more automated within your script, but propably your host wont allow this.
I can use the script if a new folder is created with 0777 but it's strange, Is this a common configuration of a webhost? don't have this with other hosts.


Last blog : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #5 on: Apr 08, 2006, 09:37:15 PM »

This is propably because the owner of the directory is not the same user with the Apache process or php runs under safe mode.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Apr 08, 2006, 09:39:44 PM »

This is not clear to me:
Quote
This is propably because the owner of the directory is not the same user with the Apache process

I know that there are often problems with the user "Apache" what has to be done in this case ?

(PHP is not in safe mode)


Last blog : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8249
42481 credits
Members referred : 3



« Reply #7 on: Apr 08, 2006, 09:50:29 PM »

For example Apache runs as user nobody and the directory is owned by the user root.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Apr 09, 2006, 10:28:30 AM »

For example Apache runs as user nobody and the directory is owned by the user root.
I think that this is the problem...I think I send an e-mail to support


Last blog : Just a better Internet portal provided by Google
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=2210
Tags : php apache directories php safemode Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: trouble with photo upload
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 05:29:56 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.739
Total Topics: 7.651
Total Members: 4.397
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: Janai

27 Guests, 6 Users online :

12 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.