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 5954953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:02:42+00:00 2026-05-22T18:02:42+00:00

I am using an httpWebRequest in my windows app to download files from a

  • 0

I am using an httpWebRequest in my windows app to download files from a webserver (sURL), to a local folder (fileDestination) as such:

Public Function DownloadFile(ByVal sURL As String, _
                        ByVal fileDestination As String, _
                        ByVal WebRequestType As String) As Boolean  


    Dim URLReq As HttpWebRequest
        Dim URLRes As HttpWebResponse
        Dim FileStreamer As FileStream
        Dim bBuffer(999) As Byte
        Dim iBytesRead As Integer
        Dim folderDestination As String
        Dim sChunks As Stream

        Try

            FileStreamer = New FileStream(fileDestination, FileMode.Create)

            URLReq = WebRequest.Create(sURL)
            URLRes = URLReq.GetResponse 'Error occurs here!!
            sChunks = URLReq.GetResponse.GetResponseStream
            DownloadProgressBar.Value = 0
            DownloadProgressBar.Maximum = URLRes.ContentLength

            Do
                iBytesRead = sChunks.Read(bBuffer, 0, 1000)
                FileStreamer.Write(bBuffer, 0, iBytesRead)
            Loop Until iBytesRead = 0

            sChunks.Close()
            FileStreamer.Close()
            URLRes.Close()

            Return True
        Catch ex As Exception
            Return False
        End Try

End Function

This works fine for the first few files. But then it starts giving the following error on the URLReq.GetResponse line:

“operation has timed out”

Anyone know what could be causing this?

  • 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-05-22T18:02:42+00:00Added an answer on May 22, 2026 at 6:02 pm

    If you’re targeting the 1.1 framework and are running multiple concurrent requests try setting System.Net.ServicePointManager.DefaultConnectionLimit

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

Sidebar

Related Questions

I'm using HttpWebRequest to download data from the website, and I noticed a bug
I'm using the HttpWebRequest class asynchronously as seen below (its a Windows application) private
I am returning XML data from the Yahoo GeoPlanet web service using HttpWebRequest .
I need Windows Phone application to upload files to a web server using the
I'm using this code to download a web page in my Metro Style app:
I m using HttpWebRequest class asynchronously as code below (its just windows application) private
I have a .net windows service that test network performance by downloading files from
I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService'
I've been using HttpWebRequest/HttpWebResponse lately and I'm getting encoding problems. HttpWebResponse.CharacterSet doesn't always represent
I need to implement a throttling mechanism (requests per second) when using HttpWebRequest for

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.