0

OK so what I'm trying to achieve is the generated SVG from a canvas using this code:

      let filedata = this.canvas.toSVG({
        suppressPreamble: true,
        width: 2025,
        height: 1425
      });

Send it using axios to a server with a Laravel API and rasterize the image using ImageMagick. Everything was working fine until I realized that when I was adding a lot of images to the canvas the SVG that I was sending to the server was too long to the point of even increasing the post_max_size setting was not enough. So is there a way to send this super long SVG to the server in like chunks? or maybe I need to use a different request header? I'm out of ideas here and ready to cry lol

Any help is welcome, thanks!

  • It would be great if you share file uploading code also. Anyways, You are right you should upload SVG data in chunks. You may have a look in to these links: [link1](https://stackoverflow.com/questions/16102809/how-to-upload-large-files-above-500mb-in-php) [link2](https://artisansweb.net/how-to-implement-chunk-upload-in-php/) . Let us know if it doesn't help you. – LilFlower Sep 01 '20 at 04:28
  • Thank you @LilFlower for now I decided to go with another solution which is to send the canvas URI with `canvas.toDataURL('image/jpeg')` and it's significantly smaller than the SVG, however I will still take a look at the links that you shared in case these URIs get too large. Thank you very much! – Miss Sandwich Sep 02 '20 at 18:17

0 Answers0