Not exactly. Check index.html. There is no javascript there. There is however a form that is being send when the user presses on the submit button. This form is sent to filehelper.
In your case it is simpler. You don't need to handle the multipart data. Just create a standard handler that reads the file from the stream and send the file with HttpJob. After the file is sent you can send a notification to the websocket.
The same is true for files being sent from the server. Send a notification with the web socket and then download the file with HttpJob.
I had been able to send bitmaps directly through web sockets but using Base64 strings, which weigh 33% more than an array of bytes.
1) I do not know how to implement this Erel's suggestion
2) I have seen how the example WebSocketWithFileUpload works; it uses a Handler class, which receives an object of type ServletRequest; can I create this type of object in B4A?
Obviously, I would prefer the Erel's suggestion (1), but how?
Thank you
Last edited: