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

Select Media from Server #1

Open
krebbi opened this issue Feb 8, 2022 · 6 comments
Open

Select Media from Server #1

krebbi opened this issue Feb 8, 2022 · 6 comments

Comments

@krebbi
Copy link

krebbi commented Feb 8, 2022

First of all thanks for your Plugin!

Is it possible to populate Thumbnails from the Server and the user is able to select one of them?

@lucasnetau
Copy link
Owner

Hi @krebbi , thanks for giving it a go.

So you would like to allow the plugin to read a directory from a server and allow the selection of an already uploaded image, rather than uploading an image directly?

@krebbi
Copy link
Author

krebbi commented Mar 19, 2022

Yes, I would like to give the plugin an array of urls from which the user can select an element to insert.

@johnpg82
Copy link

@lucasnetau Primarily the problem is if you upload a file that is too large if it is not server side it consumes all the memory in the browser and causes the browser to crash. Sending that data server side will remedy this issue.

@h3786010
Copy link

simple way:
using $.ajax() and FormData() instead of FileReader()
then return URL string after uploaded file.

@johnpg82
Copy link

Yeah I got it to work that way. Here is an example.
https://github.com/johnpg82/formBuilder-plugin-media/blob/Server-Side-Upload/media.js
I ended up just using upload.io as it offered cropping and some other features I wanted.

@lucasnetau
Copy link
Owner

simple way: using $.ajax() and FormData() instead of FileReader() then return URL string after uploaded file.

Yes, if you disable the default handler, then you can use whatever method you wish to upload. If you have any examples you want to included I can add them to the README.

There are many ways to handle the upload and post processing, depending on your use case and security model. Upload to AWS S3 with post processing is another method I've used.

For uploads in the field from short videos, sound recordings and photos we have found the data URI method to be quick and painless

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

No branches or pull requests

4 participants