Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File attachment as base64 #265

Open
robdove opened this issue Jun 6, 2022 · 3 comments
Open

File attachment as base64 #265

robdove opened this issue Jun 6, 2022 · 3 comments
Assignees
Labels

Comments

@robdove
Copy link

robdove commented Jun 6, 2022

I'm attempting to upload an image as base64 encoding.

I've tried to follow the Craft documentation for assets fields - https://craftcms.com/docs/3.x/assets-fields.html#creating-new-assets

<input type="hidden" name="attachment[data][]" value="data:image/jpeg;base64,my-base64-data......">
<input type="hidden" name="attachment[filename][]" value="filename.jpg">

Is it possible with this plugin?

@xpertbot xpertbot self-assigned this Jun 7, 2022
@xpertbot xpertbot added the enhancement New feature or request label Jun 7, 2022
@xpertbot
Copy link
Owner

xpertbot commented Jun 7, 2022

I will make this a high-priority request. I am hoping to get it out quickly.

@xpertbot
Copy link
Owner

xpertbot commented Jun 8, 2022

@robdove I was looking into this request, I apologize I thought it was a bug, but I am confused about how this is being used. I can modify the File field type to allow base64 data to be uploaded, but I am failing to understand how a file is being uploaded as data to begin with. Some more context may help me understand the problem and a concrete solution.

@robdove
Copy link
Author

robdove commented Jun 9, 2022

thanks for looking @xpertbot

I'm creating a screenshot of an element on the page using html2canvas. I then need to upload this image with the form so it's stored on the server and also emailed as part of the submission. I can only create a base64 encoded image on the front end to be uploaded. The Craft docs have an example how to upload an asset in this format and was hoping this could also be used with Wheelform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants