Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing files on FTP server with ASP

Status
Not open for further replies.

insania

Technical User
Feb 11, 2004
53
IE
Hi, I am pretty new to asp and have found some ways of using ftp but they all involve creating a text file that is run all at once.
Is there any way of using asp and ftp on the fly, i.e. I issue a command to the ftp server, it is executed and any information sent back to me. I just want to be able to run an ls or list on the ftp server and get them in an asp array.
I am used to using PHP and this is a very simple task using that, with asp it seems i have to create a very long ftp file which is executed all together, then pipe the results to yet another file which I then have to search through to get which files exist in a specific directory on my ftp server.

Any help is appreciated, thanks
 
Is the FTP server running on the same physical machine as the web server where your ASP will run? If so you could use the FileSystemObject to get a list of files and folders.

 
Its depends, Im not writing it for personal use so people may have the asp on the same physical server as the ftp area but I don't know. As Im trying to make the script as accessible as possible I dont want to limit users to having that setup available to them.

Thanks anyways
 
Thanks, I was using that script but from a different source and have now midifed it in order to do what I want. I have to get a directory listing for my project so I have to run the script once to store an ftp "conversation" (dont have a clue if that is a real term!) to a file then split the file lines into an array and see if my filename is amongst them, if it isnt I have to run that script again to upload a specified file.

Finally got there!! And it seems to work! and I only needed to use about 3 times more code than PHP... I think there must be an easier way...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top