5

I am using Node.js on Heroku, and use MongoHQ for data.

My app needs to be able to store image files, that are uploaded from the user or pulled down from other sites. I'm not looking for add-on to do image processing or the like, I just need to be able to store them and serve them. It is fine if I just reference them from within my Node app as a numerical id or the like.

Being as this is a one-person, self-funded project, I'd like to do this as cheaply as possible (I don't want to pay a lot of fees for add-ons) and prefer keep everything on Heroku for simplicity (although the latter is not a requirement, just a preference). I know I could store them in Mongo as binary, but I'm looking for something more efficient and hopefully cheaper per meg of storage.

rob
  • 9,933
  • 7
  • 42
  • 73

2 Answers2

5

Amazon S3 is the suggested way to do this - I use it all the time with heroku:

https://devcenter.heroku.com/articles/s3

Here are some node.js specific resources:

http://toolbox.no.de/search?q=s3

Node.js & Amazon S3: How to iterate through all files in a bucket?

Community
  • 1
  • 1
Andrew Kuklewicz
  • 10,621
  • 1
  • 34
  • 42
4

As far as I know, you only have reading permissions on your Heroku app folder. You can't store anything in there.
You might need to take a look to Amazon S3, it works natively with Heroku, and you pay only what you use.

Samy Dindane
  • 17,900
  • 3
  • 40
  • 50
  • 1
    Yo Samy, je viens de tomber sur une de tes réponse :) – OXMO456 Feb 15 '13 at 14:28
  • You do have read/write permissions in your Heroku app, however as the dyno is often rebooted ( about once per day as I noticed, but I'm not sure ), Heroku's infrastructure deploys your most recent commit and any additional files that were uploaded are lost forever. – SudoGuru Mar 14 '14 at 09:49