473,383 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do I browse a FTP directory location in C# and download?-Urgen

Hi

Can someone please tell me how I can browse a FTP directory location in C#
and then download.

I am using something like:

DirectoryInfo DirInfo = new
DirectoryInfo("ftp://ftp.mysite.org/myftp/MYINBOUNDTEST");
FileInfo[] Files = DirInfo.GetFiles("*.asc");

This obviously is not correct as this will work for a local file path like
"c:\mysample".

Also, the code below won't work for me as it requires the filename in the
ServerUri.

WebClient request = new WebClient();
request.Credentials = new NetworkCredential("myftp", "mypwd");
request.DownloadFile(serverUri, "sample.txt.asc");

Just as an FYI, the FTP site also requires a login/pwd. If any idea pls.
reply asap.
--
Thanks,
SDRoy
May 10 '06 #1
3 7090
V
Hi SDRoy,

You would need to implement (or borrow an existing class) which
implements the FTP Protocol. I know that in .Net 1.1 there is no class
available which provides the FTP protocol out-of-the-box. I am not sure
about the 2.0 version.

You need to implement sockets which communicate with the FTP Server
using the FTP Protocol.

I suggest you search on google for already existing code which people
have shared. One such exists at
http://www.codeproject.com/csharp/ftplib.asp

Hope that helped !

Regards,
Vaibhav

May 10 '06 #2
Thanks for the info. Forgot to mention that I am on .Net 2.0. So was trying
to get help as there are FTP Web Client classes in 2.0.
--
Thanks,
SDRoy
"V" wrote:
Hi SDRoy,

You would need to implement (or borrow an existing class) which
implements the FTP Protocol. I know that in .Net 1.1 there is no class
available which provides the FTP protocol out-of-the-box. I am not sure
about the 2.0 version.

You need to implement sockets which communicate with the FTP Server
using the FTP Protocol.

I suggest you search on google for already existing code which people
have shared. One such exists at
http://www.codeproject.com/csharp/ftplib.asp

Hope that helped !

Regards,
Vaibhav

May 10 '06 #3
Thanks for the info. Forgot to mention that I am on .Net 2.0. So was trying
to get help as there are FTP Web Client classes in 2.0.
--
Thanks,
SDRoy
"Swanand Mokashi" wrote:
Attached is the FTP client class that I have written
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"V" <va*************@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Hi SDRoy,

You would need to implement (or borrow an existing class) which
implements the FTP Protocol. I know that in .Net 1.1 there is no class
available which provides the FTP protocol out-of-the-box. I am not sure
about the 2.0 version.

You need to implement sockets which communicate with the FTP Server
using the FTP Protocol.

I suggest you search on google for already existing code which people
have shared. One such exists at
http://www.codeproject.com/csharp/ftplib.asp

Hope that helped !

Regards,
Vaibhav


May 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jane Doe | last post by:
Hi, I need to add a download function in a VB program, but since a file can be located anywhere in our /download section on the web, I was thinking of putting a PHP script there that would take...
2
by: spike | last post by:
I tried to upload a .htaccess-file to the directory that i wanted to protect. This is what I wrote in it: ------------------------------------------------ <Limit GET> order deny,allow deny from...
1
by: ASP Spam Fighter | last post by:
Hello all, I don't know how to get around this one... If anybody can help me with this problem, I would appreciate it very much. I've been trying to send a (large) file to the browser via a...
3
by: Lachlan Gemmell | last post by:
Hello there, I'd like to set the users default download folder on their PC to a certain location (if it exists). The users will be downloading documents and we want to try to minimise the...
6
by: Glenn Owens | last post by:
As a "newbie" to Javascript I need some help with my latest problem... I have a number of image files that have been pre-selected by the user for downloading. I'd like to be able to have the user...
5
by: Joe Bloggs | last post by:
I have an Oracle database that holds a Blob field containing a PDF report. I've been researching into if its possible to implement a Brose for folder functionality in a web page so to allow a user...
5
by: Eric Twietmeyer | last post by:
Hi, Does anyone know why starting with VS.NET 2002 (and same with 2003) it is no longer possible to browse to a directory that has "ept" as part of the path? It worked fine in Vc 6.x. My...
3
by: den 2005 | last post by:
Hi everybody, I like to allow user to select and browse to which location to save the pdf file of a crystal report viewed on a web page, how can i do this in ASP.Net? I need to get the path...
4
by: krishna81m | last post by:
A very interesting problem for a simple requirement and not easily available solution: How would I create a button which will allow the user to specify where the file to be downloaded will be...
1
by: Radhey Krishna | last post by:
A very interesting problem for a simple requirement and not easily available solution: How would I create a button which will allow the user to specify where the file to be downloaded will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.