Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

How can i read File Properties via FTP without downloading it ?

Thanks for your Time.

Regards.
Posted
Comments
Sergey Alexandrovich Kryukov 15-Nov-13 2:06am    
Which properties, exactly? Better yet, just see the documentation on FTP protocol and .NET implementation.
—SA
Umer Asif 15-Nov-13 2:12am    
Creation Date
Last accessed
Last Modified
Size

1 solution

First of all, to work with FTP as a client, you will need to use the class System.Net.FtpWebRequest:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=vs.110%29.aspx[^].

Then you will need to use proper System.Net.FtpWebRequest.Method. Please see:
http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.getfilesize(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webrequestmethods.ftp.getdatetimestamp(v=vs.110).aspx[^].

Probably, from what you wanted to get, you can retrieve the size and only one time property, time stamp.

—SA
 
Share this answer
 
Comments
Umer Asif 15-Nov-13 6:04am    
thank you !
Sergey Alexandrovich Kryukov 15-Nov-13 10:17am    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900