Click here to Skip to main content
12,627,002 members (35,029 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# file FTP
i want to transfer file in folder with ftp bu i took error. Error and code are in picture.
http://img855.imageshack.us/img855/4531/59182060.png[^]
Posted 29-Aug-12 0:45am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Read here: http://msdn.microsoft.com/en-us/library/system.windows.forms.folderbrowserdialog.selectedpath.aspx[^]
Quote:
The path of the folder first selected in the dialog box or the last folder selected by the user.

You probably need a file to upload. Folder length has no meaning in this context.
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,

Length property should not called for the directory. if you call FI.Length for directory it will gives you FileNotFoundException.

Refer MSDN for FileInfo.Length[^]

Thanks
-Amit Gajjar
  Permalink  
Comments
Eren GENÇTÜRK 29-Aug-12 6:11am
   
I understand. how can i call folder?i want to select folder and upload the file inside in this folder
@amitgajjar 29-Aug-12 6:13am
   
You need to call Directory.GetFiles to get all the files from specific folder and upload one by one or you can use other bulk upload method.
Eren GENÇTÜRK 29-Aug-12 7:33am
   
thanks so much.
@amitgajjar 29-Aug-12 7:33am
   
Your welcome
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

With a FolderBrowserDialog you can select folders,
you can use a OpenFileDialog to select one or more files.
More info about OpenFileDialog:
http://msdn.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx[^]
  Permalink  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161205.3 | Last Updated 29 Aug 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100