You might check out the carrierwave_backgrounder gem: https://github.com/lardawge/carrierwave_backgrounder
It might be a good reference even if you don't use it. On Thu, Apr 24, 2014 at 3:22 PM, Daniel Farina <[email protected]> wrote: > On Thu, Apr 24, 2014 at 3:18 PM, Anand Soni <[email protected]> wrote: >> Hi I am trying to write file in heroku as per the file system allowed in >> heroku. I want to do my audio file upload to S3 async manner, so I am using >> delayed_job for that. what I am doing is I am first writing content into >> file and then create a job which will upload to S3 then delete file created >> locally. >> >> For this I am writing file in "#{Rails.root}/tmp". When I check log it shows >> created but when my job worker try to access it, it never found at same >> location. I am not understating why its happening even I didn't get any >> error creating file in tmp folder in my rails app and still my job worker >> can't find the file in tmp folder >> >> Please help me to solve this. Thanks. > > The file system is not shared across different dynos: by putting stuff > in delayed_job it's going to be executed by another worker that does > not have access to that temporary file. > > If the file is a "simple" upload from the user, you might want to > consider pre-signed S3 urls. Otherwise your only other async-ish > option is to fork a worker within the web dyno that has access to the > temporary file while also returning a request immediately. > > -- > -- > You received this message because you are subscribed to the Google > Groups "Heroku" group. > > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/heroku?hl=en_US?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "Heroku Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- -- You received this message because you are subscribed to the Google Groups "Heroku" group. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/heroku?hl=en_US?hl=en --- You received this message because you are subscribed to the Google Groups "Heroku Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
