Hopefully I can help, and should probably do a tutorial on this.
If some of this is too basic, sorry just covering the bases.
1. The picture must be sent on the data line of the ajax request (in C3) to be a POST *thus avoiding error 414 issues* (the URL line in C3 is actually a GET line and you can mix GET/POST as needed). (servers usually limit GET since it goes in the browser URL, this helps avoid DDOS issues)
2. Urlencode(your data) handles your *.php str_replace items making that unnecessary.
3. No need to send the "data:image...." to the server unless you just want to, *wasted data*.
4. You might do a test TextInput box to show your base64 data just to double check it's formatting.
5. Post to server, check and see that it made your data make it (in phpmyadmin, you might want that cell to be longtext
6. On retrieval, laod from "data:image...." and ajax.lastdata .
On a side note you can "compress" the image by using drawingcanvas (it can be dramatic, especially if there are a lot of images).
***I just went through this the other day and have it working without issue. You might look at this post and read about the errors I made in the discovery process.
construct.net/en/forum/construct-3/how-do-i-8/loading-image-binary-157901