Forum Moderators: coopster

Message Too Old, No Replies

change permission & name of uploaded files

upload files,php scripts,chmod,

         

NeilsPHP

7:32 pm on Jul 21, 2008 (gmt 0)

10+ Year Member



I am letting users uploaded files(doc,pdf,jpeg,xsl etc) on my website that are getting uploaded to a directory in public_html folder.my questions:

* If I need to display those files as links in my webpage,I can use either <img src> tag or <a href> tag.But I will have to have those files in HTML directory to do that.Is there a way to do this by putting those uploaded files above HTML DIRECOTORY ? may be another option to display them in webpages ?

* How do I chmod to uploaded files automatically using php script?

* How do I change name of uploaded files using php script ?

thank you in adv

eelixduppy

7:57 pm on Jul 21, 2008 (gmt 0)



>> may be another option to display them in webpages ?

They either have to be accessible by the public or you need a script that reads the content of the file above the root directory into a document with the correct headers.

>> How do I chmod to uploaded files automatically using php script?

Use chmod [php.net]() once the file is moved to its final destination.

>> How do I change name of uploaded files using php script ?

When you upload the file with move_uploaded_file [php.net](), you need to change the destination string to the name and path that you want the file.