Home > Net >  C # connect FTP server, get success, file download failed, 550 for help
C # connect FTP server, get success, file download failed, 550 for help

Time:12-01

C # connect to the FTP server to connect to obtain a list of folders file success, downloading a single file and access to the file size to return all back to 550, path is correct, the active passive failure, use the FTP tool download is normal, for help

CodePudding user response:

Mostly, routing problem, and check the case, slash, Spaces and so on

CodePudding user response:

reference 1st floor stherix response:
most or path problem, check the case, slash, Spaces such as
path can access to the file list, but the path + name of the file used to retrieve and download file size is wrong

CodePudding user response:

refer to the second floor killing _ scholar response:
Quote: refer to 1st floor stherix response:
most or path problem, check the case, slash, Spaces such as
path can access to the file list, but the path + name of the file used to retrieve the file size and download all wrong


Try to use the address with your user name password, see
For example,
ftp://username: password @ address: port/path

CodePudding user response:

Use address can't open, use the ftpclient class, found that execute commands RETR path is 550, but OpenRead can read the file for reading files, don't understand!

CodePudding user response:

reference stherix reply: 3/f
Quote: refer to the second floor killing _ scholar response:

Quote: refer to 1st floor stherix response:
most or path problem, check the case, slash, Spaces such as
path can access to the file list, but the path + name of the file used to retrieve the file size and download all wrong


Try to use the address with your user name password, see
For example,
ftp://username: password @ address: port/path
FTP, please download or obtain document flow is the same command

CodePudding user response:

refer to fifth floor killing _ scholar response:
Quote: refer to the third floor stherix response:
Quote: refer to the second floor killing _ scholar response:

Quote: refer to 1st floor stherix response:
most or path problem, check the case, slash, Spaces such as
path can access to the file list, but the path + name of the file used to retrieve the file size and download all wrong


Try to use the address with your user name password, see
For example,
ftp://username: password @ address: port/path
FTP, please download or obtain document flow is the same command?


Download the files and access flow of something is actually a
Eventually the GET command is required to actually download

CodePudding user response:

Excuse me FtpWebRequest class in c # can only access to the file list, download 550, use the CMD to get normal again, what reason is this

CodePudding user response:

refer to 6th floor stherix response:
Quote: killing _ scholar reference 5 floor response:

Quote: refer to the third floor stherix response:
Quote: refer to the second floor killing _ scholar response:

Quote: refer to 1st floor stherix response:
most or path problem, check the case, slash, Spaces such as
path can access to the file list, but the path + name of the file used to retrieve the file size and download all wrong


Try to use the address with your user name password, see
For example,
ftp://username: password @ address: port/path
FTP, please download or obtain document flow is the same command?


Download the files and access flow of something is actually a
Eventually the GET command is required to actually download

CodePudding user response:

refer to the eighth floor killing _ scholar response:
Quote: refer to the sixth floor stherix response:
Quote: killing _ scholar reference 5 floor response:

Quote: refer to the third floor stherix response:
Quote: refer to the second floor killing _ scholar response:

Quote: refer to 1st floor stherix response:
most or path problem, check the case, slash, Spaces such as
path can access to the file list, but the path + name of the file used to retrieve the file size and download all wrong


Try to use the address with your user name password, see
For example,
ftp://username: password @ address: port/path
FTP, please download or obtain document flow is the same command?


Download the files and access flow of something is actually a
Eventually the GET command is required to actually download
consult
content on the 7th floor

CodePudding user response:

I have this class, quite good

CodePudding user response:

Using System;
Using System. Collections. Generic;
Using System. IO;
Using System. Linq;
Using System.Net;
Using System. The Text;
Using System. The Threading. The Tasks;
Using System. The Configuration;
The namespace ScheduleTask
{
Public class FtpTool
{
Private static string ftpUri=ConfigurationManager. AppSettings [" ftpUri "];
Private static string folderPath=ConfigurationManager. AppSettings [" ScheduleTaskFolder "];
Private static string ftpFullDirectoryPath=Path.Com bine (ftpUri, folderPath);//Ftp storing files in the folder into the diameter
Private static string ftpUserID=ConfigurationManager. AppSettings [" ftpUserID "];
Private static string ftpPassword=ConfigurationManager. AppSettings [" ftpPassword "];
Public static bool Upload (string fileFullPath)
{
Bool isSuccess=false;
The FileInfo the FileInfo=new the FileInfo (fileFullPath);
String uri=Path.Com bine (ftpFullDirectoryPath, the fileinfo. Name);//all Ftp storage file into the diameter
if (! MakeDir (ftpFullDirectoryPath)) return isSuccess;//if the folder does not exist, create
Try
{
Var tempPath=Download (uri, the fileinfo. Name);
If (tempPath!=null)
{
System. Diagnostics. FileVersionInfo fileVersion1=System. Diagnostics. FileVersionInfo. GetVersionInfo (fileFullPath);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C#
  • Related