Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
152 views
in .NET FTP by (120 points)
We are using edtftpnetpro for uploading using uploadstream method but it fails saying "file stream too long"
by (154k points)
Can you post a log file snippet or stack trace?
by (120 points)
I am using console application. While debugging i am getting the above error while executing the exe the process is uncontinously running
by (154k points)
We need a bit more detail to have any chance of helping - stack trace or debug log.
by (120 points)
At stack trace i am getting the below error.
  at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)

   at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)

Getting the exception when uploading the file from stream using uploadstream method
by (154k points)
If you are trying to hold the entire 2 GB file in memory, you are unlikely to succeed.
by (120 points)
Can you let me know how can i do FTP more than 2 gb file using uploadstream method. It will be helpful if i get any snippets for the same

1 Answer

0 votes
by (2.7k points)
You can do it by passing the FileStream directly to the UploadStream method.  You can obtain a FileStream object either by calling File.OpenRead or by creating a new FileStream object.  When you do this, the FileStream object will read the data from the file as it's read by the UploadStream method instead of reading it all into memory at once.

Categories

...