0

I've been using the /tmp directory of elastic beanstalk to generate files that I would like to make available for users to download. However, I'm having some trouble linking properly to that folder from a view. Below is what I've tried:

<a href= <%= "/tmp/#{@project.id}/doc.kml" %> download>Download KML</a>

This filepath works in the project model and project controller pages, but not when accessed from the view. From the view page, it resolves as follows, with "no file found":

http://my_app_name.elasticbeanstalk.com/tmp/1/doc.kml

I believe this is pointing to the tmp folder of my app root directory, while I want to go up a level outside the app root for the tmp directory there. Is there a trick to accomplish this?

  • No if you want to serve static file with your http server - I guess you need to serve it with controller. – Marek Lipka Mar 19 '19 at 12:53
  • if your file is temporary per a request, you need to use app's tmp dir, if not you need to upload this file to another service like S3. – NeverBe Mar 19 '19 at 17:37
  • @NeverBe the file is temporary, but I have [not been able](https://stackoverflow.com/questions/27980478/how-can-i-create-a-tmp-directory-with-elastic-beanstalk) to write to the app's tmp dir in EB. I'd rather not put on S3, would prefer to use the app/tmp dir if you have advice on that – Luke Rogers Mar 21 '19 at 17:27
  • @MarekLipka, could you explain or link me to an explanation to serve with the controller? – Luke Rogers Mar 21 '19 at 17:30

0 Answers0