Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12.2k views
in .NET FTP by
Anything I ever try to run through the .Put method after obtaining a connection and logging in throws a System.FormatException.

"Input string was not in a correct format."

I went as far as to go into the code posted at

http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm?page=last&x-order=date

by Jesse Liberty, and received the same exact error - failing on the .write method of the stream.

I can't seem to find in here that ANYBDOY else has had this problem, but I'm doing something so simple that I can't fathom what's going on. I ran the example client from the above article verbatim and received the same result.

Can anybody help? Thanks. :)

13 Answers

0 votes
by (162k points)
Since Jesse's code is ours, no surprise. Are you using 1.0.1? This has a possible fix.

Anything I ever try to run through the .Put method after obtaining a connection and logging in throws a System.FormatException.

"Input string was not in a correct format."

I went as far as to go into the code posted at

http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm?page=last&x-order=date

by Jesse Liberty, and received the same exact error - failing on the .write method of the stream.

I can't seem to find in here that ANYBDOY else has had this problem, but I'm doing something so simple that I can't fathom what's going on. I ran the example client from the above article verbatim and received the same result.

Can anybody help? Thanks. :)
0 votes
by
I got around by avoiding the overload that takes a file path from the local machine by manually getting the bytes of the file and Putting them rather than allowing edtftp to handle it.

The problem was either { or } character appearing in my source document that I was transferring. It works fine when I get my own bytes, doesn't work if I let edtftp do it.

Binary Jay


Since Jesse's code is ours, no surprise. Are you using 1.0.1? This has a possible fix.

Anything I ever try to run through the .Put method after obtaining a connection and logging in throws a System.FormatException.

"Input string was not in a correct format."

I went as far as to go into the code posted at

http://www.ondotnet.com/pub/a/dotnet/2004/05/10/ftpdotnet.htm?page=last&x-order=date

by Jesse Liberty, and received the same exact error - failing on the .write method of the stream.

I can't seem to find in here that ANYBDOY else has had this problem, but I'm doing something so simple that I can't fathom what's going on. I ran the example client from the above article verbatim and received the same result.

Can anybody help? Thanks. :)
0 votes
by
I was getting the same error when trying to ftp the file. The problem was that I didn't specify the transfer type. I added the code to designate the transfer type and it worked. See the code below...

Dim ftp1 As New EnterpriseDT.Net.Ftp.FTPClient("192.168.1.205", "21")

ftp1.Login("user", "pass")
ftp1.TransferType = EnterpriseDT.Net.Ftp.FTPTransferType.BINARY
ftp1.Put("C:\test.pdf", "test.pdf")
ftp1.Quit()
0 votes
by
I had the same error doing a put of a XML file in ASCII mode, switching the transfer mode to BINARY worked fine, but I'm guessing this might be a bug. I would not expect to use BINARY mode for XML files.
0 votes
by (162k points)
We'll check this out as you probably shouldn't need to use binary for XML.

Note however that the XML standard does allow auto-detection of encoding via special chars at the beginning of the document, called the byte order mark - see

http://www.w3.org/TR/2004/REC-xml-20040 ... c-guessing

However we'll take a look at the document you emailed us and check it out

I had the same error doing a put of a XML file in ASCII mode, switching the transfer mode to BINARY worked fine, but I'm guessing this might be a bug. I would not expect to use BINARY mode for XML files.
0 votes
by (162k points)
We can replicate the error in 1.0.1 - should have a fix soon

I had the same error doing a put of a XML file in ASCII mode, switching the transfer mode to BINARY worked fine, but I'm guessing this might be a bug. I would not expect to use BINARY mode for XML files.
0 votes
by (162k points)
We have a fix available - 1.0.2.

Anyone with this problem if you could email support at enterprisedt dot com and we'll send you a preliminary build to test out.
0 votes
by (162k points)
We reckon it works. 1.0.2 is up there for download. Please let us know if this is still a problem.

We have a fix available - 1.0.2.

Anyone with this problem if you could email support at enterprisedt dot com and we'll send you a preliminary build to test out.
0 votes
by (280 points)
I seem to be running into a varent of this issue, it only happens sporadically.

I am running edtFTPNet PRO 5.1

I've narrowed it down to 3 particular clients(out of roughly 50+ we send files to) I am unsure if it is the file content, but it seems to be the file name,

But, when I try uploading/downloading all these files, that error out with the Input string error, they work fine using file zilla.

It seems any time the filenames have an underscore"_" or dash "-" I get the Input string not in a correct format error.
Below are some example file names.

1813_20081015040342.zip.pgp
CFA.LETTERS.20081016_2915.3616.pgp
NSE.INFORMED.VENDOR.09-2008

I've debuged the code, and the exception is happening inside of the edt library so there is nothing I can do to fix this myself.

Unfortunately this is in a production environment and none of our clients have test environments I can play with, so I'm unable to turn on the level of logging I'd prefer to send to you.

Any Ideas of how to fix this?

Thanks,

Albert
0 votes
by (162k points)
Are you transferring in ASCII or binary mode? There might be some non-ASCII characters in your file.

Email us the stack trace if possible.

Categories

...