Hello all,
I have read the following tutorial "Uploading Files To the Server Using PHP" and have several questions related to the topics.
Q1> The tutorial mentions that
"Note that PHP must have write access to $uploadDir or else the upload will fail"
For me, I only allow the user to upload the file after the user has login to the website. If we set that $uploadDir permission as 777, then everyone can have written permission to that folder. How to avoid this problems?
Also I am using WAMP as my testing bed, can I simulate the same case as a real web server?
Q2> In order to prevent Preventing direct access, the tutorial mentions:
"A better approach is to move the upload directory away from your web root. For example, the web root for this site is: /home/arman198/public_html/ to prevent direct listing i can set the upload directory to /home/arman198/upload/."
Now my problem is that how can I display the uploaded images on other website pages. Since, the upload is not accessible directly anymore? I need to display the uploaded image save personal headshot dynamically on other website page. Is it possible?
Thank you