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

Create FileField, ImageField, VideoField #109

Open
redgeoff opened this issue Nov 8, 2018 · 0 comments
Open

Create FileField, ImageField, VideoField #109

redgeoff opened this issue Nov 8, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@redgeoff
Copy link
Owner

redgeoff commented Nov 8, 2018

These fields should allow you to upload a file, image and video respectively. Once an image is uploaded, the ImageField should display the image. Once a video is uploaded the VideoField should use the browser's native capabilities to display a video player.

To support both large and small files, the upload operation should be configured to call a back-end API immediately after the user selects the file to upload. This configuration should probably be in the form of an event that is emitted on the field whereby you create a listener to perform the upload to the back end. During the upload, a progress indicator should be displayed. The back-end API will return a URL that can then be used to display (or link to) the file. We should be able to support any API: GraphQL, RESTful API, etc... by requiring that the upload work is performed by an Action.

An optional enhancement for the future is to have a configuration that instead uploads the file in the browser and then base64 encodes the file data in the form's values. This would most likely only be useful for small files, as large files would take up a lot of browser memory because the contents cannot be streamed. Moreover, transmitting these files in single chunks to say a back-end would be very slow.

@redgeoff redgeoff added the enhancement New feature or request label Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant