unnamed Posted December 14, 2007 Share Posted December 14, 2007 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 Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted December 14, 2007 Share Posted December 14, 2007 the url you provided is just a sub-directory in a file manger that does not have a index page. Quote Link to comment Share on other sites More sharing options...
unnamed Posted December 14, 2007 Author Share Posted December 14, 2007 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 Quote Link to comment Share on other sites More sharing options...
CMC Posted December 14, 2007 Share Posted December 14, 2007 You don't need a script. Just drop the files onto the server and it will output that automatically as long as there is no index file. Quote Link to comment Share on other sites More sharing options...
unnamed Posted December 14, 2007 Author Share Posted December 14, 2007 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.