i have a b4j server, receive file from client, the client is other program, i use postman to test.
i send a text file(test.txt), the content is:
my server receive the post file, save to disk, the content is:
my server's code is:
what's wrong with my code?
i test png/jpg files too, the question still exist.
thanks.
i send a text file(test.txt), the content is:
B4X:
BEGIN
line1
line2
line3
END
B4X:
----------------------------617993333513995102880868
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
BEGIN
line1
line2
line3
END
----------------------------617993333513995102880868--
B4X:
If req.Method <> "POST" Then
'error msg......
Return
End If
Dim In As InputStream = req.InputStream
Dim filename As String = "filename"
Dim filepath As String = "filepath"
Dim out As OutputStream = File.OpenOutput(filepath, filename, False)
File.Copy2(In, out)
out.Close
i test png/jpg files too, the question still exist.
thanks.