Is there a designated location for saving temporary files for serving to the user?

I dynamically create a PDF file and need to save it somewhere for the user to download. Which directory should I use to store these files?


There's no specific location set by ExpressionEngine. Addons use the cache folder for dynamically generated files, but if you're creating an actual PDF I would create a tmp directory in the public_html directory.

| improve this answer | |
  • The files location is up to developer, but if the PDFs are user-specific, I would save them in user personal folders (location again is up to you). If the content is sensitive, I would place the files outside of public_html and retrieve using add-on like Protected Links – Yuri Salimovskiy Feb 3 '13 at 14:46
  • That Protected Links addon is a very good suggestion. Kudos. – Carlo Laitano Feb 4 '13 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.