locked
Upload big file (10 GB) on ftp server using c# (win app) RRS feed

  • Question

  • Upload big file (10 GB) on ftp server using c# (win app)
    • Moved by Bob Shen Thursday, October 11, 2012 6:34 AM (From:Visual C# General)
    Wednesday, October 10, 2012 7:43 AM

Answers

  • There should not be any problems in uploading large files if you input and output streams are correct.  I would recommend spliting the files into smaller chunks before send the large files.  FTP uses TCP transport layer to send data which will remain open for weeks at a time.  So the size and time the connection stays open isn't an issue.  What does become an issues is the buffers/stream that are used to read and write the file.  You should use non blocking functions for the read and write to the file (asynchronous methods).

    jdweng

    • Marked as answer by Vikas Agrawal Monday, October 15, 2012 11:51 AM
    Thursday, October 11, 2012 1:35 PM

All replies

  • Hi Vikas,

    According to your description, I'd like to move this thread to Network Class Library (System.Net)Forum for better support, where more experts live.
     
    Thanks for your understanding.

    Bob Shen [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, October 11, 2012 6:33 AM
  • There should not be any problems in uploading large files if you input and output streams are correct.  I would recommend spliting the files into smaller chunks before send the large files.  FTP uses TCP transport layer to send data which will remain open for weeks at a time.  So the size and time the connection stays open isn't an issue.  What does become an issues is the buffers/stream that are used to read and write the file.  You should use non blocking functions for the read and write to the file (asynchronous methods).

    jdweng

    • Marked as answer by Vikas Agrawal Monday, October 15, 2012 11:51 AM
    Thursday, October 11, 2012 1:35 PM
  • Hi Joel,

    Thanks for your input. Can you refer me any URL where I can get a sample. I have a big zip file which I need to upload on ftp and I want that application should resume from last stage in case of network failure or uploading interepted. In case of Zip file I need unzip and upload or I can do it directly.

    --Vikas

    Monday, October 15, 2012 11:49 AM
  • Thanks Bob...
    Monday, October 15, 2012 11:50 AM
  • Below is one example that uses a math fucntion to get the size of each chunk

    http://www.codeproject.com/Articles/31114/Split-large-XML-files-into-small-files

    Instead you can read a fix number of bytes where the last chunk will usually be less than the chunk size


    jdweng

    Monday, October 15, 2012 12:47 PM
  • Thanks Joel,

    Let me try this making small files and then uploading on ftp. If I stuck in another issue then I will get back again :).

    -- Vikas

    Monday, October 15, 2012 2:14 PM