Get/Read a file on S3
I have a pdf located in a server side directory. Using a Iron Router route, like 'get-pdf', I read this file with fs node.js (readFileSync) and do a response.write(file), which renders the pdf in the browser. This works. But now what I want to do is read in a file stored on S3 and do a response.write(file-s3).
Is this possible with your package?
It's not as easy as it sounds sadly. I'm not sure if Amazon would support something like that. This is what I'm going to try to implement further down the road so it might be out of the scope of the project.
Thanks for the feedback. So, how do you 'get' things store in S3 for use in your website? I mean, it's kinda pointless to have a one way drop bucket of files right? Even if I could get a file stored on S3 and copy it/write it out to my local file system, this I think would be enough. Once it's on my file system I can do what I wish with it.
You use the URL supplied by the callback to get the file basically. So in your application I guess you would upload to S3, save the URL in a collection, then when you modify you would show the user a "loading" indicator while the file is downloaded to your server via the collection URL so that you can make edits via fs, then upload and replace on S3 after it's done. I completely removed my server side uploader though because it was having issues corrupting data. :O
Thanks. I think your approach is the path I will take.