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

Show preview of image in FileUploadWidget? #526

Open
ITChick2018 opened this issue Aug 17, 2022 · 4 comments
Open

Show preview of image in FileUploadWidget? #526

ITChick2018 opened this issue Aug 17, 2022 · 4 comments

Comments

@ITChick2018
Copy link

I'm a newbie in programming and can't find any helpful documentation for my problem...
I want to use deform in my pyramid app. I used the FileUploadWidget to save my images in db.
This works fine, but i can't figured out how I can show a preview of the uploaded image (eg in edit form).

Can you help me, or give me a hint for my problem?

thx :)

@stevepiercy
Copy link
Member

Do you want to preview the image after you select it but before you submit the form, or do you want to preview it after you submit the form?

Deform does not do the former. You would need to use another tool and integrate it into a custom file upload widget, such as https://blueimp.github.io/jQuery-File-Upload/.

For the latter, you would need to retrieve the image (or its information) from the database, and render it in your template, again by creating a custom widget.

Sorry, I do not have an example of either at hand. It is left as an exercise for the developer. You can also post to the pylons-discuss Google group or Stack Overflow, per our General Support policy.

@ITChick2018
Copy link
Author

Thanks for your help. I want to show a preview before and after submit. I try to write a custom widget.

@ITChick2018
Copy link
Author

One more question?
how to use the preview_url?

@stevepiercy
Copy link
Member

I have no idea what is preview_url.

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

2 participants