I need to POST a big string (>2mb) to my heroku app from the client using javascript.
Then I need to store the string in cloudfiles or s3.
What is the best way to do this, taking into account the limitations of Heroku?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best way to deal with large file and heroku is to use javascript to post it directly to s3 (or your final destination), then use a callback to hook it up to your model.
The main reason is this — heroku will timeout on any request taking longer than 30s, so if there is any risk that you uploading will take more than that, then you HAVE to bypass heroku (note: I have learned this from experience)
There a bunch of options to accomplish this depending on what you requirements are:
Note: none of these are super simple to setup
I wish that there was a simpler alternative, it is amazing to me that something as fundamental as file uploading is this difficult.