Template to Display Uploaded Images
Closed this issue · 1 comments
Hi Joe,
As part of the testapp, any chance you could include a simple view & template that would display the images uploaded using s3file? Maybe where currently the upload view redirects to show the json file names of what was just uploaded - instead it could render them onto a page?
I'm sure someone with your skills could whip it up in no time (I'm told flattery can get you everywhere :) ). Kidding, but it'd really be appreciated by noobs such as myself.
Thanks
Hi @pdf9,
Excellent question! As it turns out, this is not possible right now, at least not out of the box. We do not emit a signal, for files that have been uploaded. However, this could be easily implemented around here:
django-s3file/s3file/static/s3file/js/s3file.js
Lines 91 to 96 in b604060
All that being said, if you S3 bucket is not public, you will need to make a signing request to your app server. I would recommend this, having your bucket public by default has caused a great many security incidents in the past.
Anyhow, I would be open to add the event, but bear in mind, that this will not fully solve your problem. I believe it might be simpler to just submit the form and display the image in the next step. Another solution would be to show the picture that is being uploaded, while it's being uploaded via JavaScript, see https://stackoverflow.com/a/4459419/649951
I hope this gives you an idea of how to tackle your problem.
If you have any further questions, please let me know. Should you be interested in adding a JS signal for successful uploads, please reopen this issue.
Best,
Joe