Cyber Posted July 29, 2009 Share Posted July 29, 2009 Hi all! I found many function for TCP file trasfert, but its hard to work with big file >_< Do you have a function with example? Thanks! Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
monoceres Posted July 29, 2009 Share Posted July 29, 2009 Read & send the file in smaller chunks (for example 32 kB). Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Cyber Posted July 29, 2009 Author Share Posted July 29, 2009 Read & send the file in smaller chunks (for example 32 kB). how? Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
monoceres Posted July 29, 2009 Share Posted July 29, 2009 FileRead has a count parameter, so this for exampe reads 32 kB of data. $fhandle=FileOpen("test.file",16) $data=FileRead($fhandle,32*1024) Then you just have to send that data and redo the process until no more data could be fetched from the file (end of file). On the reciever side you just dump everything that comes through the socket into a file. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Cyber Posted July 29, 2009 Author Share Posted July 29, 2009 (edited) FileRead has a count parameter, so this for exampe reads 32 kB of data. $fhandle=FileOpen("test.file",16) $data=FileRead($fhandle,32*1024) Then you just have to send that data and redo the process until no more data could be fetched from the file (end of file). On the reciever side you just dump everything that comes through the socket into a file. Thanks I try but my code don't work. Can you help me please? >_< Opt("TrayIconDebug", 1) TCPStartup() $sock = -1 Do $sock =TCPConnect(@IPAddress1,3333) Until $sock <> -1 $fhandle=FileOpen("file.rar",16) $r = "" $i = 0 Do $r = TCPRecv($sock, 1000000) if @error <> 0 Then ExitLoop EndIf if $r <> "" Then $i += 1 TrayTip("",$i,1) FileWrite($fhandle, $r) EndIf Until @error <> 0 FileClose($fhandle) TCPCloseSocket($sock) TCPShutdown() Opt("TrayIconDebug", 1) TCPStartup() $mainsock = TCPListen(@IPAddress1, 3333) $sock = -1 Do $sock = TCPAccept($mainsock) Until $sock <> -1 $fhandle=FileOpen("test.file",16) $i = 0 While 1 $i += 1 ;~ TrayTip("",$i,1) Sleep(10) $data=FileRead($fhandle,32*1024) If @error = -1 Then ExitLoop TCPSend($sock, $data) Wend FileClose($fhandle) TCPCloseSocket($sock) TCPShutdown() Edited July 29, 2009 by Cyber Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
monoceres Posted July 29, 2009 Share Posted July 29, 2009 You need to open the output file in write mode, so replace "FileOpen("file.rar")" with "FileOpen("file.rar",17) Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Cyber Posted July 29, 2009 Author Share Posted July 29, 2009 You need to open the output file in write mode, so replace "FileOpen("file.rar")" with "FileOpen("file.rar",17)WORK!!!!!FANTASTIC!!!!!!!!!THANKS!!! >_<THANKS THANKS THANKS THANKS THANKS THANKS!!! Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now