简体   繁体   中英

How to reduce base64 image data and save to another varible?

I am facing browser crash while sending base64 image data from one HTML page to another HTML page. So, I want to reduce this base64 string and store it to another variable and then I want to pass that variable.

So how do I reduce base64 image data in JavaScript?

To reduce a string you should reduce the image itself. If you cannot control size of images (for example, if it is an image which is uploaded by the user) then you should consider another way to send images.

For example, you can use POST instead of GET (query string). Either use <form> tag or post via javascript (example: JavaScript post request like a form submit ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM