PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

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 8th, 2004, 03:05 PM
secks secks is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 5 secks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP: File writing question

howdy,
is there anyway i can have a user upload an image and then write the image to a directory without having to enable ALL BROWSER USERS Write access to a directory. So somehow i would embed admin priveleges into a php page or something. Im sure this sounds confusing. But I just don't want to enable write permissions to a directory because then anyone that finds that directory can put whatever they want into it. The server is running windows.

-paul

Last edited by secks : March 8th, 2004 at 03:06 PM. Reason: title

Reply With Quote
  #2  
Old March 9th, 2004, 06:45 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
You have to enable write permissions for saving a file to disk.
But how do you think all users can just put anything in that folder? Unless you have a trojan or something... You can restrict your upload pages in many ways. Htaccess is a way but you can also use simple sessionvariables.
Maybe I didn't understand your question completely... could you explain a bit more what exactly your problem is?
__________________
Work to live, don't live to work

Last edited by Spongy : March 9th, 2004 at 06:46 AM. Reason: Typo

Reply With Quote
  #3  
Old March 9th, 2004, 05:08 PM
secks secks is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 5 secks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by Spongy
You have to enable write permissions for saving a file to disk.
But how do you think all users can just put anything in that folder? Unless you have a trojan or something... You can restrict your upload pages in many ways. Htaccess is a way but you can also use simple sessionvariables.
Maybe I didn't understand your question completely... could you explain a bit more what exactly your problem is?

well .. if i knew that that directory had write permissions enabled .. wouldnt i be able to write a script on another server that could upload a file to that write-enabled directory? or is that not possible?

Reply With Quote
  #4  
Old March 10th, 2004, 06:28 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
Interesting question... I never looked at it this way... I think you can use your group permissions on a directory, so that only the web-user can write.
Another option is to restrict the uploadfolder for localhost only. Don't know for sure, never tried it. Maybe someone else got ideas about this? I will search for some material about this...

Cheers,

Reply With Quote
  #5  
Old March 10th, 2004, 09:54 AM
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 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Make a folder that only the browser can save to, outside of the www root directory, test a few files uploading to that dir.. unless you are talking about separate users uploading like for a bulletin board.. you can also have them upload the images and stuff into a database, it would probably be easier to do it that way, because then you can have user assigned permissions and everything within the db, and only admin's could remove the pictures and/or other content

Reply With Quote
  #6  
Old March 10th, 2004, 10:53 AM
secks secks is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 5 secks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by nicat23
Make a folder that only the browser can save to, outside of the www root directory, test a few files uploading to that dir.. unless you are talking about separate users uploading like for a bulletin board.. you can also have them upload the images and stuff into a database, it would probably be easier to do it that way, because then you can have user assigned permissions and everything within the db, and only admin's could remove the pictures and/or other content
ya i was going to do that, but the only problem is the database has a 50meg size limit. which is pretty weak. but good suggestion thanks!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP: File writing question


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 2 hosted by Hostway