Pylons / deform

A Python HTML form library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Show preview of image in FileUploadWidget?

ITChick2018 opened this issue · comments

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 :)

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.

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

One more question?
how to use the preview_url?

I have no idea what is preview_url.