I'm writing a PHP script which communicates with another program via files. I wonder if there is some policy or standard on where to put such files? I assume choosing a path like C:\foo\bar\ isn't the best? If nothing else it's not portable.Would $_SERVER['HOME'] be a good place or is there something more appropriate? The temp folder is not good as the files technically aren't temporary.For a Windows application I think you would typically use %appdata%\\{company name}\\{app name} but that's obviously not that great for PHP.
PHP filesystem best practice
php
Typically the right place for a file exchange folder would be outside of the webroot where both web applications have access to. So it's anywhere, except where other files reside.Files will generally be FTP'ed or SFTP'ed (FTP over SSH) to the server, or share the same folder on the host if they are served from the same machine (actual machine or VM).Make sure that you remove the files after they have served their usefulness. Last thing you want is a big bulk of files in a folder that you will never (ever) use again...Hope it helps