General discussion

Locked

Simple FTP via ASP.NET web app.

By bgibilaro ·
I have been developing a simple web app that allows our clients to query information from our SQL server and then export it into a flat file.

So here is my question:

What is the easiest and cleanest way to simply allow a user to enter an ftp server address, username, password and path in a web form that, when submitted, will automatically transfer the flat file to their ftp server in the folder they designated in the path field?

When the flat file is initially generated, it is stored on our web server, so there would be no need for the user to upload a file from their own computer.

I am using VB.NET to develop my ASP.NET app.

I hope this is enough info. Any help you can offer would be greatly appreciated.

Thanks.

Bob Gibilaro

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Simple FTP via ASP.NET web app.

by ncseric In reply to Simple FTP via ASP.NET we ...

I'm assuming you know how to make the basic ASP.NET form work properly and take data from a DataTable/DataSet and put it in a file. If not, drop me a note and I'll give you some code for it.

There are a few steps required:

1) Your web server process (ASP.NET worker process) needs to be able to write the file to disk temporarily.

2) The file should be named using something random so that the next attempt to generate an export file doesn't stomp on the file name. I typically use a GUID(Use the Guid built-in type) to generate a random filename.

3) I would use a pre-built component to handle the FTP from the server to the other server. Mabry Software has an easy-to-use FTP component for .NET development for $200. I believe the component has methods that allow you to change folders to the one selected by the user. You would have to do some validation to make sure the folder is valid.

4) Once the file has been transferred, I'd delete it from the local server or archive it for the user who requested it.

If you need further assistance or details, feel free to contact me directly.

- Eric

Collapse -

Simple FTP via ASP.NET web app.

by bgibilaro In reply to Simple FTP via ASP.NET we ...

Eric,

Thanks for the assistance. This is a huge help.

Bob

Collapse -

Simple FTP via ASP.NET web app.

by bgibilaro In reply to Simple FTP via ASP.NET we ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums