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

  • Home
  • SEARCH
  • 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 7173579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:51:15+00:00 2026-05-28T15:51:15+00:00

I have a program that uploads files to our server when they are dropped

  • 0

I have a program that uploads files to our server when they are dropped over the form, to make it easy for our customers to get large files to us.
I have it mostly working, but I want to have a progress bar so that the user knows it’s working, instead of having it just sit there for 5 minutes while the files upload quietly in the background.

I would be happy to just have the progress bar pulse so it looks the program is working, and not frozen. If I can show actual status then that would be better.

My code:

Private Sub Grid1_Drop(sender As System.Object, e As System.Windows.DragEventArgs) Handles Grid1.Drop
    Dim sFileInfo As System.IO.FileInfo
    Dim sStatus As String = ""

    If e.Data.GetDataPresent("FileDrop") Then
        Try
            Dim theFiles() As String = CType(e.Data.GetData("FileDrop", True), String())
            For Each file As String In theFiles
                sFileInfo = New System.IO.FileInfo(file)

                If UploadFile(txtUsername.Text, sFileInfo) Then
                    lstFileList.Items.Add(file & " - Uploaded")
                Else
                    lstFileList.Items.Add(file & " - Upload Failed")
                End If
            Next
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End If
End Sub

Public Function UploadFile(ByVal User As String, ByVal oFile As FileInfo) As Boolean
    Dim ftpRequest As FtpWebRequest
    Dim ftpResponse As FtpWebResponse
    Try
        ftpRequest = CType(FtpWebRequest.Create(Base + User + "/" + oFile.Name), FtpWebRequest)
        ftpRequest.Method = WebRequestMethods.Ftp.UploadFile
        ftpRequest.Proxy = Nothing
        ftpRequest.UseBinary = True
        ftpRequest.Credentials = Cred
        ftpRequest.KeepAlive = KeepAlive
        ftpRequest.EnableSsl = UseSSL
        If UseSSL Then ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)
        Dim fileContents(oFile.Length) As Byte
        Using fr As FileStream = oFile.OpenRead
            fr.Read(fileContents, 0, Convert.ToInt32(oFile.Length))
        End Using
        Using writer As Stream = ftpRequest.GetRequestStream
            writer.Write(fileContents, 0, fileContents.Length)
        End Using
        ftpResponse = CType(ftpRequest.GetResponse, FtpWebResponse)
        ftpResponse.Close()
        ftpRequest = Nothing
        Return True
    Catch ex As WebException
        Return False
    End Try
End Function
  • 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-28T15:51:16+00:00Added an answer on May 28, 2026 at 3:51 pm

    Have a look at the background worker class. http://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx which will free up your ui so you can add in a progress bar control and have it animate while your files are being uploaded

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

Sidebar

Related Questions

I'm using threads in a program that uploads files over sftp. The number of
I have written a small program and server to upload large files over HTTP
I have a program that runs osql.exe from microsoft sql server tools directory and
I have a program written in python that uploads an archive (zip file) to
I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of
I have a program that spits out both standard error and standard out, and
I have a program that creates a Windows user account using the NetUserAdd() API
I have a program that uses the mt19937 random number generator from boost::random. I
I have a program that spits out an Excel workbook in Excel 2003 XML

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.