28, May 2012

trouble with photo upload - webmaster forum

 
Webdigity webmaster forums
[ 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
Instabuck - The easy way to sell digital products online

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


It's time to use PHP5!


« on: Apr 08, 2006, 12: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?

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Apr 08, 2006, 11:16:30 am »

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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Apr 08, 2006, 03: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.

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



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

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

Maybe you can try the php chmod 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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


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

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

Maybe you can try the php chmod 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.

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #5 on: Apr 08, 2006, 08: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Apr 08, 2006, 08: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)

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #7 on: Apr 08, 2006, 08: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 or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Apr 09, 2006, 09: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

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....

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?
May 28, 2012, 11:19:26 am





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!






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