Jump to content

PHP FTP Directory Listing and Download


unnamed

Recommended Posts

Hi all, is it possible for PHP to connect to an FTP Server located on another domain from the original script and list the content of a specific directory on the ftp to allow users to download the file(s) without them knowing the ftp username/password and full address? i would like it to be able to list the directory a bit like http://files.spip.org/spip-zone/ if this can be done could you please give me some guidance on how to do so?

 

Cheers

Link to comment
Share on other sites

yeah/ Thanks for the quick reply.

 

What I want is a script that will list an ftp directory as follows:

 

 

Index of /ftp/

 

name size

----------------------------------------

file_1.exe 1.6M

file_2.exe 2.4M

file_3.exe 9.1M

file_4.zip 3.7K

file_5.mp3 4.2M

folder_1    -

folder_2    -

folder_3    -

folder_4    -

image_1.jpg 55k

image_2.jpg 364k

 

 

and then when a user clicks on a file it will download the said file, or when s/he clicks on a folder name it will open a new directory of that folder and do the same...

 

I know this can be done with the .htaccess for html but I need a PHP script that will connect to an FTP server and make the same result, if this is at all possable?

 

Cheers

Link to comment
Share on other sites

ok... sorry, what i mean is mydomain.com has limited space (25MB) and that's running seriously low at the moment, so what we wanted to do is move some of the files to our office ftp server at ftp://ftp.ftp and let the users download the files that way but we can't have extra ftp user accounts, so this means if we want people to download from the ftp server we would have to give them the master username and password and this could cause all kinds of trouble. now i'm sure somebody out there has a script that could connect to the ftp server from our main site at mydomain.com and list a directory of ftp://ftp.ftp/downloads/ without disclosing the username/passwort, right? or is this not possable?

 

Cheers

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.