locked
Uploading and Downloading (without dialogues) RRS feed

  • Question

  • I have a situation where I need to upload and download files to the database. The file name and location never changes, so no "Browse" or "Save As" dialog is necessary. I am able to upload via a button with the following code:

    Dim myDocs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
                dim folder = myDocs & "\Phone Tools and Utilities\"
                Dim file = folder & "donor.nam"
                Dim stream As FileStream = New FileStream(file, FileMode.Open)
                Dim byteSize = stream.Length
                Dim kB = Math.Round(byteSize / 1000)
    
                Me.FlashJob.FlashFileName = stream.Name.Remove(0, folder.Length)
                Me.FlashJob.FlashFileSize = kB & "KB"
                Me.FlashJob.FlashFile = stream.ToBinary

    How would I go about downloading so I can automatically overwrite the existing file?

    Wednesday, October 23, 2013 5:53 PM

Answers

All replies