|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
Quote:
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? |
|
#4
|
||||
|
||||
|
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, |
|
#5
|
||||
|
||||
|
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
|
|
#6
|
|||
|
|||
|
Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP: File writing question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|