How to create binary files out of base64 encodes strings in submissions

  • Profile Image
    VladCT
    Asked on March 09, 2017 at 05:24 AM

    Hello!!

    I have a form where user can send Delivery contact.I put an image from the form editor then from source code i set an ID for the image.In javascript  i change the source of image with a Base64 code before user Submit the form.In my page, image is present, but when i receive in my dropbox the pdf document of the form , image is not present.My base64 code is actually a screenshot of a Tshirt that user customize.So i have multiple div elements and image.The screenshot is take with html2canvas  so i have to keep the base64 format to not have the cross domain problems.

    I tried with input type file but i can not set a default value because of security.If anyone have any ideeas for that please let me know. Or somethink like an upload method to send the base64 image to Dropbox from the jotform submit action.

    Thanks!!

  • Profile Image
    Boris
    Answered on March 09, 2017 at 09:57 AM

    A base64 string is essentially a textual input - not a binary file.

    As such, it cannot get passed as a binary file. It gets passed to your integrated services (Dropbox, Google Drive) as text, so it can only be included inside the PDF file of the submission, or inside a cell of an integrated Google Spreadsheet.

    To achieve such a functionality, you would need to perform your own extraction of these base64 textual strings from the submissions you receive, and reconstruct the binary files on your own end.

    Thank you.

  • Profile Image
    VladCT
    Answered on March 09, 2017 at 12:06 PM

    Thank you for your answer, i will try that, and then i will post the solution