On my site is use ratchet websocket. When i try to send an image to the webserver i previously used base64 encoding. Encode the image to base64 and send via ratchet websocket. But for this project PHP is running on 32 bit machine; therefor Ratchet craches because it cant process the base64 incomming data as it doent support 64 bit.
var DataUrl = canvas.toDataURL('image/png');
creates a to large value for Ratchet to receive on server.
64-bit format codes are not available for 32-bit versions of PHP in /var/www/projectname/websocket/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php:163 Stack trace: #0 /var/www/projectname/websocket/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php(163): unpack()
[source from someone else who has this problem]
Installing 64 version of PHP isnt an option because server is 32 bit.
Alternative i created is a separate upload script via AJAX and only send the image-name (created on client) via ratchet. Not the whole image. The benefit of using base64 is that i can use same dataurl as css-background-url.
This alternative is very impractical. E.g.cant use some data on the server to include in the image-name (or i have to retrieve it beforehand). And i have to link to the image instead of using the already existing dataurl.
My question: can i send the image via ratchet by encoding it via a different way that supports 32 bit machines? I read about blob and some other things.
Search google for a couple hours but couldnt find a decent answer.