If you are a front-end developer, who ever worked on picture uploading, video uploading or audio uploading to the backend, then you should know tha...
For further actions, you may consider blocking this person and/or reporting abuse
People transmit images as base64? Why? I've always used FormData or octet stream, so the start of this post confused me.
I think one use case could be when you want to your APIs to use JSON. Sending form data means your API is consuming formats other than JSON. Also sending data in a form has some limitations I guess. Its best for as the name suggest forms. What if sending media is involved in a process that doesn't included one. I faced a scenario, and that is when I leaned about base64. I cant exactly remember what factors were stopping me from using form but I wanted to send and receive image data and I could not use a form so I had to follow this approach. The good thing is that you don't have to manually convert the image to base64 inside the browser. There is a web API that exposes a property named dataUrl that already contains the base64 form of the uploaded file.
quora.com/What-is-the-purpose-of-b...
The abover quora, will give your answer.
Interesting article. Whenever I read an article saying "do it this way because it's faster" I wish the author would have run performance tests and included the results. If they haven't run tests, how do they know that it's actually faster?
I haven't run the test, but I faced this issue, while developing a scenario, where we have to upload multiple audiobook chapters, and the former way of sending and receiving data is crashing the website, and taking a lot of time (while uploading 500MB of one episode), but with the later version with FormData, its workinh smoothly.
Great! What you described is an informal performance test. "Uploading a 500 MB file used to crash the server, but with the new code that doesn't happen any more". Perhaps add a couple of sentences about that to the article?
Uploading a 500 MB file used to crash the server, but with the new code that doesn't happen any more
If it is more or less, what happens?
LOL Beans
Especially as converting base64 to/from binary data is super fast - the slow part comes because base64 representation is a lot bigger, so if uploading/downloading in that format, it will use more bandwidth and thus take longer
Did you ever send an image data to the backend?
There is an example there on how to send file
developer.mozilla.org/en-US/docs/W...
yup. Recently came to know about it.
That's great.....
how about using ajax. ajax can upload binary data. my example, upload image file:
gitlab.com/birowo/latihan/-/blob/m...
image will previewed and compressed before upload. all information about image : file name etc. put on url
AJAX could be a good alternative too for uploading binary data.
What about gRPC, with this it is possible to send bidirectional binary data from client to backend