Writing files on VIP Go

VIP Go platform specific

This document is for sites running on VIP Go.

Learn more

VIP Go stores uploaded media in a globally distributed object store. We have seamlessly integrated this service with VIP Go WordPress installations using WordPress’ Filesystem API. For security reasons, the local container filesystem is mostly read-only: it is not possible for PHP to write files to any part of the system except the system temporary directory.

We recommend that you avoid writing files even to the system temporary directory, but we recognize that sometimes this is necessary, and in these cases, you must follow these conditions:

  • You can only write to the system temp directory. Use get_temp_dir() to find the right path.
  • Files need to be removed by the end of the request that created them. Use unlink() to remove your files.
  • Files can only be relied on for the duration of the current request.
    • Each request may be served by a different container, and the sequence of requests from a given user are not guaranteed to be served by the same container
    • We don’t guarantee that a given container will be around for any length of time; containers may be created and destroyed due to autoscaling at any point
  • The existence of directory structures within the system temp directory can only be relied upon for the duration of the current request; i.e. if you need a directory structure to write to, your code must check for the existence of that structure and create it if it does not exist.

If you have any questions about directly writing to the filesystem, please don’t hesitate to get in touch with the VIP team so we can work with you on the implementation.

Ready to get started?

Drop us a note.

No matter where you are in the planning process, we’re happy to help, and we’re actual humans here on the other side of the form. 👋 We’re here to discuss your challenges and plans, evaluate your existing resources or a potential partner, or even make some initial recommendations. And, of course, we’re here to help any time you’re in the market for some robust WordPress awesomeness.