php email attachment, chmod settings

This is a discussion on php email attachment, chmod settings within the PHP Language forums, part of the PHP Programming Forums category; I have a php script from Obie (link at bottom) which uploads a file to the web server, then attaches ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-15-2005
Andy McAllister
 
Posts: n/a
Default php email attachment, chmod settings

I have a php script from Obie (link at bottom) which uploads a file to
the web server, then attaches it to an email, and sends it to a default
recipient.

This program requires setting a directory for the files to reside in
temporarily. What settings should I put this folder to to be most
secure, 755? 750? other? If the user is uploading, is that the
"world" permissions, or is that the "group" or "owner" permissions?
I'm not entirely sure how the upload in this script works, but it uses
the "open()" "fopen()" and "fread()" functions in there.

http://obiewebsite.sourceforge.net/o...ith_attachment

Thank you thank you thank you.

Reply With Quote
  #2 (permalink)  
Old 03-15-2005
Andy McAllister
 
Posts: n/a
Default Re: php email attachment, chmod settings

I see now that the uplod is RFC-1867:
http://us3.php.net/manual/en/features.file-upload.php

But this act of uploading - is that "owner" "group" or "other"?

Also, the fread() (which will setup to base64 encode the file): is that
running with owner, group, or other privileges?

Reply With Quote
  #3 (permalink)  
Old 03-15-2005
Geoff M
 
Posts: n/a
Default Re: php email attachment, chmod settings

drsmartz@yahoo.com says...

> But this act of uploading - is that "owner" "group" or "other"?


Seeing as you used the term "chmod" I presume you are talking about a
linux/Apache/PHP setup.

In that scenario the PHP script are usually run by the Apache "user" -
e.g. on my test server that user's name is "webserver" and that user is a
member of a group called "web", of which my personal user account is also
a member.

My preference for folders to be used by php for write as well as read is
personally-owned by me but group-owned by "web", and with permissions of
775 (read/write for owner and group, read-only for world). If I was ultra
cautious I might do 77x.

Geoff M
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:40 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0