Downloading .php Files From Web Directories

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
BMN
Forum Newbie
Posts: 15
Joined: Fri Aug 12, 2005 10:54 pm

Downloading .php Files From Web Directories

Post by BMN »

Hello,
I am able to browse a directory on a web server and view the file list. This includes the php files, etc. on the server. When I try to download the php files from the directory they save as 0kb .html files.

I have tried "saving file" through IE6 and Firefox with no luck. Firecfox says it is downloading the file and then it disappears from the saved location, and IE6 saves it as a 0kb .html file.

Are there any applications/tools/fixes that are available for me to copy the .php files that I need?


Thank you.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

are you trying to download files that belong to you and in your host?
if it does not, then you cannot download php files...
BMN
Forum Newbie
Posts: 15
Joined: Fri Aug 12, 2005 10:54 pm

Post by BMN »

The files are on a remote server. Not my server. I do not have root access or FTP access to the server.

Why can I view the files but not download them?
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

BMN wrote:The files are on a remote server. Not my server. I do not have root access or FTP access to the server.

Why can I view the files but not download them?
when you say you are able to view...you are viewing the generated HTML file from the PHP file .... is not it?
You cannot have access to server side scripts unless it is your script...even if it is your script...you can download the code by only means of FTP or any user interface given by the host.
BMN
Forum Newbie
Posts: 15
Joined: Fri Aug 12, 2005 10:54 pm

Post by BMN »

I am viewing the directory list.
(eg) index.php
12.php
hello.php
, etc.

These are examples of the files I can see. When I try to right-click and "save as", it saves as a 0kb file.

These are the files I am trying to download.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

because the server is parsing the file when you download it..
think about it, if we could simply download the raw file, then you could steal anyones source code
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Jcart wrote:because the server is parsing the file when you download it..
think about it, if we could simply download the raw file, then you could steal anyones source code
think about the sensitive db information that might be stored in it...it is kinda inherent security to server side files...
BMN
Forum Newbie
Posts: 15
Joined: Fri Aug 12, 2005 10:54 pm

Post by BMN »

I thought security was the reason for not being able to download it. But I was confused because I could view the file.


Thanks for clearing that up and explaining it to me. That has been a great help!
Post Reply