Question

I have an PHP application hosted on AppFog and sometimes it need to generate some files and store them on the server. Files are saved with file_put_contents() or with imagejpeg() and imagepng() functions. After a while files became removed. Can you tell me why and how can I prevent it?

Was it helpful?

Solution

Many PAAS providers, including AppFog, do not provide a persistent filesystem. Generally, you can save files but they will be removed when you redeploy your application.

For persistent file storage, you are encouraged to use a cloud provider like Amazon S3.

From the AppFog FAQ:

Does AppFog have a persistent file system?

Not yet. We're working on this feature, but in the meantime, the file system is volatile. This means that any changes you make to the file system through a web interface, including any admin changes and content uploads, will be lost on the app's next start, stop, restart, deploy, or resource change. Because of this, you should make any changes to the file system on a local development environment and keep media assets and content uploads on an external storage system like Amazon's S3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top