1

Please help me to avoid direct access when we enter the path to file/image..

4
  • What exactly is your problem? Commented Aug 31, 2012 at 11:47
  • you can validate a file to download only when someone is login to your website. Commented Aug 31, 2012 at 11:51
  • user can download only when they signin. Commented Aug 31, 2012 at 12:06
  • stackoverflow.com/questions/10596116/… Commented Aug 31, 2012 at 12:23

3 Answers 3

5

Put your image outside web folder and serve it with php.

Sign up to request clarification or add additional context in comments.

Comments

0

You can set Directory listing to false for the folder you want to protect from direct access. In your hosting panel there is a option to set this Parameter.

Comments

0

If you are using cPanel, use "Hotlink Protection". Hotlink protection prevents other websites from directly linking to files on your website. You can block direct access by specifying extensions. You can add jpg, png, gif,etc. for this problem.

Here is the tutorial.

https://www.cpanel.net/media/tutorials/hotlink_lo.htm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.