Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to Convert Image URL to base64 without downloading the file

How would I be able to convert an image from a URL to base64 without downloading a file?

Example:
https://pbs.twimg.com/profile_images/1455185376876826625/s1AjSxph_400x400.jpg

I want to access this URL and convert the image to base64 without the need to download the image itself.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So far I can only do it by saving the file but is it possible to do it without downloading it?

>Solution :

Short answer. No.

Long answer. To process the file in any way, like encoding it, the file must be read into some memory accessible by the processor that will act upon it.

So, if the encoding process is running in your laptop then you need to download the file contents into it, saving it into a file, or directly to the stream in memory for the encoding process.

But, if the encoding process is done by a server of yours, sitting somewhere in the cloud, then you might not consider the content transfer as a "download". Purely terminology, because anyway, your server will need to access and read the file.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading