Zubrag.com
June 20, 2018, 06:42:29 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Protect Images  (Read 9806 times)
Cookie Monster
Newbie
*
Posts: 12


« on: March 14, 2010, 07:27:19 PM »

Is there any way to protect images with this or some other script that can be combined with this script?  I noticed that my file is protected at http://www.MyWebsitesName.com/protect/file.php, but any jpeg files I have associated with that page can be accessed without a username and password if someone directly accesses http://www.MyWebsitesName.com/protect/image.jpg.  Is there a way to correct this so that the images are also protected with the password?  Thanks!

Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #1 on: March 15, 2010, 12:44:29 AM »

Okay, I figured out that I need to password protect the folder that the images are in.  I made an .htaccess and .htpasswd file and put it in the folder.  However, a new log-in screen pops up to validate that username and password.  Is there a way to incorporate this with the current (super awesome) advanced password protection script that zubrag offers (so that it does not ask for the username and password again)?  Thanks again....
Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #2 on: March 16, 2010, 02:32:24 AM »

HELP!  PLEASE!   Smiley

I created an index.php file in my protected folder that would show the contents of the folder, of which is filled with images that I want only the validated user to access.  Along with the index.php file, I also created a .htaccess and .htpasswd file.

The simple .htaccess file is

AuthType Basic
AuthUserFile /home/content/u/s/e/useraccount/html/website/protect/folder/.htpasswd
AuthName "Log-in"
require valid-user

And then there is a simple .htpasswd file in the same folder, of course.

But I still can't figure out a way to incorporate this into the current script so that it does not ask for the password for a second time when accessing the images folder I protected.  Any ideas, please?!
Logged
1ststop
Newbie
*
Posts: 30


« Reply #3 on: March 16, 2010, 06:00:49 AM »

You're going about it all wrong.
Scrap the htaccess etc and go back to the begining, where you started.

Now go back to zubrag's main site at http://zubrag.com and download his 'Smart File Download' script. That will do what you want. I use it myself and can vouch for it. It only allows download via specific link and link parameter addition. Direct download via hotlink or direct link is blocked.
Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #4 on: March 16, 2010, 01:15:09 PM »

Thanks for the reply.  I did look at that download script and couldn't figure out how to get it to do what I am wanting to achieve, but I will try again.  I need the folder to be open on the website so that the person can view all the files in the folder and then access them from that directory listing, which I have achieved with what I did with my index.php script I created.  I also need all those files to be password protected.  I guess I didn't see how download.php would achieve that, but I will take another look.  Hmmm....
Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #5 on: March 17, 2010, 04:06:49 AM »

http://www.zubrag.com/forum/index.php/topic,182.0.html

I went to that topic, and I have now combined the advance password protect, the simple password protect, and the downloader, and I don't know what I am doing wrong, because I can still download the image files without logging in....
Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #6 on: March 17, 2010, 04:21:39 AM »

Any help would be appreciated.  It was so simple to install the Advanced Password Protect Script but trying to combined it with the download script to protect my jpeg files from access without a password is not making any sense.  I am not an advanced user, but I usually understand scripts rather quickly.  Like I said, I get the Advanced Password Protect Script, and I love it, but I cannot get it to work with my jpeg files being protected.  Any more help?
Logged
1ststop
Newbie
*
Posts: 30


« Reply #7 on: March 18, 2010, 05:06:56 AM »

So...
You have advanced password protect installed which directs a user to your index containing thumbnails of download images.
Is this correct?

If you now have 'Smart File Dowmload' installed then that is all you need. From your index with protected images you should link to each image like this download.php?f=image1.jpg instead of image1.jpg

Your images should not be in an easily guessable folder. Download.php will contain the information regarding the download folder location and this information is never shown to  a user. Direct linking is not possible unless you know the exact URL. Even if a user copies and pastes the download.php link into their browser they will not be allowed to download the file.
Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #8 on: March 18, 2010, 11:42:45 PM »

1st Stop--Thanks for the clarification. I now understand why it is not doing what I want it to. I will try to post more later, but right now my 800-some character post is being stopped on here because it says it exceeds the 1,000 charcter limit so there must be a forum glitch right now, but I will try to post later and wanted to thank you for the reply.
Logged
Cookie Monster
Newbie
*
Posts: 12


« Reply #9 on: March 18, 2010, 11:48:36 PM »

Rest of my message:  I want my website guests to be able to access the folder directory and all its contents. So, I am not linking the images on an index.php page, but rather they are going to index.php and seeing the directory folder, (labeled "images," for example), which they can click on and then see & click on all the contents of that folder in a more raw form, which is not near as pretty, I realize. The reason I am doing this is because I am going to allow someone I trust to upload images to this directory folder, and they do not feel they have the skills to enter images in the code of on an html or php page, so there will not be any links to images....Just other users accessing that directory folder from index.php.  So, I think I will have to stick with the Advanced Password Protect with the .htaccess and .htpasswd files and have them enter their passwords twice, unfortunately, but thanks for taking the time to reply! Have a great day! Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC