Forum Moderators: coopster

Message Too Old, No Replies

How to download a password protected file

         

unni

5:56 am on Aug 8, 2006 (gmt 0)

10+ Year Member



I have a local php page to download daily log files.

I dont know about php http authentication. So i am using it like this

echo '<a href="http://www.a.com:2082/getaccesslog/accesslog_a.com_8_8_2006.gz">site a</a>';

Now problem is every time it is asking for user name and password.

Whats the best way to do it? is there any option with i can include the user name and password inside the code and download the file directly without prompting for password?

jatar_k

3:05 pm on Aug 12, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you may be able to just grab them from the file system with out having to worry about the auth

or did you want the auth?

jay5r

3:12 pm on Aug 12, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



You can embed the user name and password in the URL like this:

[username:password@example.com...]

It's not terribly secure, but it works.