Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8509257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:23:08+00:00 2026-06-11T03:23:08+00:00

I have a page where users can create their own SVG images. Now I

  • 0

I have a page where users can create their own SVG images. Now I would like to access these images on the server (php) so they can be sent to an email address.

With these instructions I am able to convert the SVG to a canvas and then convert the canvas to jpeg/png. I’m not worried about the SVG tree anymore as it doesn’t need to be edited anymore, thus converting it to a normal image (I was assuming that would be easier to handle, ultimately I want to send that image as an attachment in the email).

What would be the most efficient way of doing this? Is it possible to POST the converted jpeg/png to the server? Thanks guys, kinda lost here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:23:09+00:00Added an answer on June 11, 2026 at 3:23 am

    After a lot more reading I managed to find a fairly simple solution, in case anyone has a similar problem here it is:

    Once you have converted the SVG to a normal canvas using canvg you can make use of the canvas.toDataURL() method, all you need to do then is POST the generated URL and decode it on the server. I used a hidden input field for this. Be careful not to use JQuery for getting the canvas, since JQuery doesn’t return the actual canvas but a JQuery Object.

    var canvas = document.getElementById('canvas');
    var dataUrl = canvas.toDataURL();
    $('#hiddenInput').val(dataUrl);
    

    And on the server side:

    $encodeData = $_POST['dataUrl'];
    $encodeData = substr($encodeData, strpos($encodeData, ',') + 1); //strip the URL of its headers
    $decodeData = base64_decode($encodeData);
    $handle = fopen('test.png', 'x+');
    fwrite($handle, $decodeData);
    fclose($handle);
    

    The SVG is now on the server as a png.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine we have a page with a form where users can create their own
I will create an ASP.NET Web Application like this; Users can login their own
I have a site where users can create their own profile pages with their
I have a Page with many Comments. Many users can access this page and
Here is my situation. I have a web page for users to create their
I have an and users can login and view their own profile with a
I have a form on a page that a user can use to create
I have created a page on my site where users can post directly to
I have a page where users can select different documents files in a datalist
I have a web page where users can see data from MongoDB on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.