Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Storage.get returns a URL to reach the object.
What is the desired behavior?
Have an option to actually get the object, similar to the aws-sdk S3#getObject method. Otherwise, if I want to actually download the object for some reason, I'm making two AJAX calls, which seems a bit silly when it can be accomplished with one through the original SDK.
Which versions of Amplify, and which browser / OS are affected by this issue? Did this work in previous versions?
Working on 0.4.0.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Ping? This seems relatively simple to implement?
Unless I'm misunderstanding usage?... just seems excessive to make two calls for every object access.
seems like this just went stale, no response yet? @AndrewSouthpaw i agree, it's redundant having to make two calls to achieve one simple task.
Okey with a little further dive into the actual get function i see that there is a download option
so you can just do:
Storage.get(`filename.pdf`, { download: true }).then(result => console.log(result))
Good to know, thanks!
Can you update the documentation please. I really like some this project but at nearly every turn of implementing it I have problems , I am not so experienced and poor documentation really hinders developers like me progress. Please update the documentation.
I mean look this is straight from the documentation :
Protected level
To get current user鈥檚 objects
Storage.get('test.txt', { level: 'protected' })
.then(result => console.log(result))
.catch(err => console.log(err));
where is the information about this ? I'll do it if you don't want to, just show me what to do
i hear you and i agree. made a start on the docs, please have a look at https://github.com/aws-amplify/docs/pull/2416 and let me know what else you want to add.
Closing, thanks to https://github.com/aws-amplify/docs/pull/2416.
I agree that, were we to create Storage.get again, we'd want to validate existence before returning successfully.
Unfortunately, we can't do so in a backwards-compatible manner. What's really needed is a way to _link_ to an object (with validation) and _get_ an object.
If & when Storage gets a major upgrade, this is behavior we'll consider.
Most helpful comment
Okey with a little further dive into the actual get function i see that there is a download option
so you can just do: