Forum Moderators: coopster

Message Too Old, No Replies

http access via php on IIS

Is it possible to access?

         

AlwaretE

1:41 pm on Jul 17, 2009 (gmt 0)

10+ Year Member



Hi there, I have a question that comes from my ignorance:

I'm on a IIS server but I have no access to any configuration. I only have FTP access to the website's main folder.

In here, there is a HTTP password protected folder (from which I know the login/password). I'm storing there some files with different formats that I don't want public access to via URL. Here's the question:

Can I access to this folder with a PHP script so the in the user end never pops up the HTTP login/password prompt?

I will really appreciate any help or workarounds on this.
Thanks.

andrewsmd

6:12 pm on Jul 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you can ftp in there then you should check out the ftp functions with php. You could do anything in php that you do through a normal ftp command prompt.

AlwaretE

7:16 pm on Jul 17, 2009 (gmt 0)

10+ Year Member



HEY! thanks for the response. I tried with a basic ftp_copy(source_file,destination_file) function and it worked, but it takes a while to connect via FTP. Then I realized that I didn't need FTP and made it directly with the copy function.

The solution:
I can create a header that protects the php pages based on the user's login and password. Whenever a user needs to download a file from the protected folder, I copy it it to a temporary location (with php's copy()), download it and then delete it.

Thanks!