[support] Drupal File Operations (D715)

Austin Einter austin.einter at gmail.com
Sat Oct 27 01:36:54 UTC 2012


Dear All
I have some basic question in regard to file operations.

*1. file_manage table*
Whenever we use file_save_upload api to upload a file, I can see one
corresponding row is added to file_manage table.
My question is, the row in file_manage table is temporary one or it will be
there always. I am planning to read some information from file_manage table
afterwards, if it is just a temporary entry, probably I will be in trouble.

*2. File / directory permission*
My hosting is a linux based hosting. My understanding is whenever a user
uploads a file, finally the web server writes the file to system.
So the webserver application is the owner.

In my case, first I create a folder (with permission 0755), and then write
the file (with permission 0664) to that folder.
Next time I want to delete the old file and write a new file it is not
possible from same user who wrote the file last time or from any other user.
Can somebody explain me why the permission issue comes here as always it is
the webserver that writes the file, so virtually owner remains same.

If I keep the folder permission 0777 then second time file write is
possible.

And, by keeping folder permission 0777, am I bringing up a security issue
here....



Thanks and Regards
Austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20121027/5636fd44/attachment.html 


More information about the support mailing list