|
-
Sep 24th, 2000, 11:35 AM
#1
Thread Starter
Junior Member
Hello! I am in a little bit of a "jam" here!! I am creating a Winsock Client/Host application..
I have everything the way i want so far, ., Except for one little problem! When i want the host portion of my program to send a file.. The program first has to open this specific file into a Binary Variable and then it begins sending it into chunks!
***************************************************
Public Sub SendFile(FileName As String, Transfer As Winsock)
Dim FreeF, Stoper As Integer
Dim LocData(1 To 2048) As Byte
FreeF = FreeFile
Open FileName For Binary As #FreeF
Do While Not EOF(FreeF)
Get #FreeF, , LocData 'Get data from the file nCnt is from where to start the get
Transfer.SendData LocData 'Send the chunk
Loop
Close #FreeF
Sleep 200
End Sub
************************************************
////////////////////////////////////////////////
But the Problem with this is that if i want to send a larger file (lets say 50MB++) .,,. the program really uses up the (HOST) HD space becasue it stores the whole contents of the file in to 1 variable in my vb application , and then it gradually begins sending the chunks of data.
I guess what i am primarily asking, is , is there a way to open a specific part of a file and load it into a variable.,.,
Lets say, i want the first 200 bytes of a file loaded into a variable withought having loaded the whole file into my application!
and then proceeding from the 200 byte section to the 400 byte section.,.,giving me again another 200 byte chunk of data.(200 byte was used just for example , doesn't have to be 200)
To clarify this a little bit more,, I want to open up a specific part of a file in to a variable withought having first gone through the whole contents of the file!
*******************************************
I know this is long, But i would really appreciate it if anyone helped me here!
*******************************************
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|