NYCPHP Meetup

NYPHP.org

[nycphp-talk] Where to store tmp files? Where to store generated files?

Rob Marscher rmarscher at beaffinitive.com
Sat May 22 21:34:07 EDT 2010


On May 22, 2010, at 8:45 PM, Matt Juszczak <matt at atopia.net> wrote:

> I know in an application, if you need to create tmp files, it's  
> probably best to use PHP's temporary file functions to create unique  
> filenames in the location defined by php.ini/the environment.  Is  
> that correct?

Yes. I agree with that.

> But in the case of needing to create files and store them for longer  
> periods of time, where do you usually store them?

What kind of files are they?  I push user uploaded files to Amazon S3.  
That scales well.  But not good if you need to keep writing to the  
files (unless your app runs on ec2). I'm not really into storing files  
in mysql because I work mysql hard enough as it is.

What's your reason for not storing them somewhere in your codebase and  
ignoring them from source control?  I don't see anything wrong with  
that. You can always rely on those locations existing which you  
probably can't for any other location on the system (unless your  
machines are all the same).




More information about the talk mailing list