Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:58:26+00:00 2026-06-17T15:58:26+00:00

Please considering the code below, it works very well with Small files (Less than

  • 0

Please considering the code below, it works very well with Small files (Less than 50 MB) but files with 100MB or more, it crashed. and give following error.

“Unable to write data to the transport connection: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.”

'Method
Private Sub Upload(ByVal source As String, ByVal target As String, ByVal credential As NetworkCredential)
    Dim request As FtpWebRequest = DirectCast(WebRequest.Create(target), FtpWebRequest)
    request.Method = WebRequestMethods.Ftp.UploadFile
    request.Credentials = credential
    request.Proxy = Nothing
    Dim reader As New FileStream(source, FileMode.Open)
    Dim buffer(Convert.ToInt32(reader.Length - 1)) As Byte
    reader.Read(buffer, 0, buffer.Length)
    reader.Close()
    request.ContentLength = buffer.Length
    Dim stream As Stream = request.GetRequestStream
    stream.Write(buffer, 0, buffer.Length)
    stream.Close()
    Dim response As FtpWebResponse = DirectCast(request.GetResponse, FtpWebResponse)
    response.Close()
End Sub

'Calling Function
Dim credential As New NetworkCredential("FTPUserName", "FTPPassword")

Upload(FileName.Zip, "ftp://abc.com/Location/FileName.Zip", credential)

Please give advise what I am missing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:58:27+00:00Added an answer on June 17, 2026 at 3:58 pm

    Please use this script. works great and I have tested it with 200+ GB of file.

    Private Sub Upload(ByVal sourceFiles() As String)
        Dim cm As ConnectionManager = Dts.Connections.Add("FTP")
        cm.Properties("ServerName").SetValue(cm, Dts.Variables("User::FTPServerName").Value.ToString())
        cm.Properties("ServerUserName").SetValue(cm, Dts.Variables("User::FTPUserName").Value.ToString())
        cm.Properties("ServerPassword").SetValue(cm, Dts.Variables("User::FTPPassword").Value.ToString())
        cm.Properties("ServerPort").SetValue(cm, "21")
        cm.Properties("Timeout").SetValue(cm, "0")
        cm.Properties("ChunkSize").SetValue(cm, "1000")
        cm.Properties("Retries").SetValue(cm, "1")
        Dim ftp As FtpClientConnection = New FtpClientConnection(cm.AcquireConnection(Nothing))
        ftp.Connect()
        ftp.SendFiles(sourceFiles, Dts.Variables("User::FTPFolder").Value.ToString(), True, False)
        ftp.Close()
    End Sub
    

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please i need help, this code below works fine on my localhost, php5.3+ but
I can't express what I want to do. Please help. Considering my code below:
I was reading this article and I have some questions please: considering this code
I'm considering using LESS for CSS development with server (or development) side processing, but
please have a look at the following code import java.util.ArrayList; import java.util.List; public class
This should be a pretty straightforward classes and interfaces question, but please bear with
Please consider the following: I am storing around 1.2 Million TIF files ranging from
I am trying since more than 3 hours to setting up multiple account for
Many try/except/finally-clauses not only uglify my code, but i find myself often using identical
Given the following code without considering friendship between two classes: class OutSideClass { ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.