Can anybody suggest a solution how to download a PDF file using network socket (TCP/IP, not FTP!)?
I have a listing server on my windows PC which accepts binary data as well as strings.
Connecting to the PC works fine and the data sent by my tablet are received by the PC's server socket as well. If I download raw text files or even pictures (JPG, BMP …) those files will be correctly transferred and viewable.
This does - unfortunately - not work for PDF files.
My simplified code:
Sub Service_Start
Log("Service started")
' connect to server
ClientSocket.Initialize("ClientSocket")
ClientSocket.Connect(HostIP,HostPort,2000)
End Sub
Sub ClientSocket_Connected (Successful As Boolean)
Dim FileStream As InputStream
If Successful Then
Log("Socket connected")
FileStream = File.OpenInput(File.DirAssets, "Test.pdf")
File.Copy2(FileStream, ClientSocket.OutputStream)
Else
Log("Socket not connected")
End If
End Sub
Thanks!
@ I worked out a solution to that problem
Please ignore this thread
I have a listing server on my windows PC which accepts binary data as well as strings.
Connecting to the PC works fine and the data sent by my tablet are received by the PC's server socket as well. If I download raw text files or even pictures (JPG, BMP …) those files will be correctly transferred and viewable.
This does - unfortunately - not work for PDF files.
My simplified code:
Sub Service_Start
Log("Service started")
' connect to server
ClientSocket.Initialize("ClientSocket")
ClientSocket.Connect(HostIP,HostPort,2000)
End Sub
Sub ClientSocket_Connected (Successful As Boolean)
Dim FileStream As InputStream
If Successful Then
Log("Socket connected")
FileStream = File.OpenInput(File.DirAssets, "Test.pdf")
File.Copy2(FileStream, ClientSocket.OutputStream)
Else
Log("Socket not connected")
End If
End Sub
Thanks!
@ I worked out a solution to that problem
Please ignore this thread
Last edited: