amplify-ui
amplify-ui copied to clipboard
[Feedback] S3 Image Picker On Completed Upload Trigger?
Page: /ui/storage/s3-image-picker/q/framework/angular
Feedback:
I have gotten the S3 Image Picker to work and when I click the button, it uploads to my S3 bucket, but then it just sits there. How do I know when the upload has completed and can direct back to another page? I noticed the S3 album has a handleOnLoad, is there something similar for the image picker?
hi @ucjallen - do you get an error message? Can you provide more info about your environment? Version of Amplify, etc... ? Thank you
I had some help from the aws subreddit, so, basically you need to use a Hub.Listen("storage") for the upload success event. That initially wasn't working until I added the "track" param to the image picker as well. Then i finally received the storage events that the image picker was using. This should definitely be mentioned in the documentation, because the storage events do not fire without the track param added!
Unfortunately, there is not enough customization available with the current image picker, no cropper, no dimension restrictions, no resize ability and no file type restrictions, so I ended up writing a custom image picker using a file input, an image cropper library and the Storage.put method
Hi @ucjallen - going to re-open this so we can verify this issue and update the S3 Image Picker Docs
@ucjallen thanks for this tip was wondering how to do it and wanted to stay in the confines of the amplify ecosystem.
there should DEFINTELY be a callback function that monitors upload status and returns the file path / signed url.
Seriously, amplify-s3-image-picker has ZERO documentation on its API options and how to use it.
Here is what my solution ended up looking like for a profile page image component in angular. It is mobile friendly as well. Hopefully this helps anyone that finds this.
I also used an image cropping library as well and got that to work with it. It is setup with cognito as well
https://github.com/ucjallen/s3-image-picker/tree/master
Closing out as the S3 Image Picker component has been deprecated.