Results 1 to 2 of 2

Thread: File Transfer Resume

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Ft Hood, TX, USA
    Posts
    1

    Post

    I'm currently working on a file transfer program in vb. I have it working well, and I want to add the ability to resume a file.
    I currently open the file For Binary Access Write As fileNum
    and in the data arrivial event I have:
    Dim data As String
    sckReceive.GetData data
    Put #fileNum, , data
    'Update the progressbar
    ect...
    I send the file like this:
    Dim hIn, fileLength, ret
    Dim data As String
    Dim blockSize As Long
    blockSize = 2048
    hIn = FreeFile
    Open fileName For Binary Access Read As hIn
    fileLength = LOF(hIn)
    Do Until EOF(hIn)
    If fileLength - Loc(hIn) <= blockSize Then _ blockSize = fileLength - Loc(hIn)
    data = Space$(blockSize)
    Get hIn, , data
    sckSend.SendData data
    sizeOfFileSent = sizeOfFileSent + blockSize
    'Update progressbar
    Loop
    I need to know how to start reading a file from a certain byte, and to write starting at a certain byte or for append. Doesn't append add carriage returns and line feeds...
    Any help is appreciated.

  2. #2
    Addicted Member señorbadger's Avatar
    Join Date
    Oct 2003
    Location
    Mud pools of wellingborough
    Posts
    193
    couldnt you read from the files LOF since this is where it got to last

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width