Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working on an autoupdater
#1
And I'm trying to make it support downloading files into subdirectories. It collects the file from the right subdirectory on my webserver, but when it saves it, it gives me the old "file not found" routine.

This is my sub for downloading:

Code:
Public Function DownloadUpdates(srcFileName As String, targetFileName As String, SubDir As String)
  Dim B() As Byte
  Dim FID As Byte
  B() = frmUpdate.Inet.OpenURL(Path & SubDir & srcFileName, icByteArray)
  FID = FreeFile
  targetFileName = SubDir & srcFileName
  Open targetFileName For Binary Access Write As #FID
    Put #FID, , B()
  Close #FID
  DoEvents
End Function

I get the file not found on this line here:
Code:
Open targetFileName For Binary Access Write As #FID

To answer any future questions, yes, this is mostly copied from a popular updater on pscode.com, and no, I don't really know what I'm doing here. I mean, i do. I can make it write the file in the root directory that the updater is in, but SubDir holds the target subdirectory, like \GFX\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)