Hello,
i have an Handler, i call in this handler a sub, in this sub i have parameters, one of the parameter is the input stream, i put the input stream from the handler in it and save the picture.
After saving it, i can not open the picture, because it is broken.
I have test a while and if i save the picture on the handler sub, then the picture is not broken.
why can this be? will the inputstream damaged if i put it in a parameter?
here a test code:
Greetings
i have an Handler, i call in this handler a sub, in this sub i have parameters, one of the parameter is the input stream, i put the input stream from the handler in it and save the picture.
After saving it, i can not open the picture, because it is broken.
I have test a while and if i save the picture on the handler sub, then the picture is not broken.
why can this be? will the inputstream damaged if i put it in a parameter?
here a test code:
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
Dim In As InputStream = req.InputStream
CheckImage(In)
End Sub
Sub CheckImage (In As InputStream)
Dim out As OutputStream = File.OpenOutput(Main.ContentPicFolder, "test.png", False)
File.Copy2(In,out)
out.Close
End Sub
Greetings
Last edited: