Check out this blog: https://community.jboss.org/people/ozizka/blog/2013/01/06/openshift--how-to-make-uploaded-files-public
OpenShift application code is loaded using Git. Any changes to the repository directory are recreated after clicking. Therefore, saving downloaded files there will not work.
The only permanent directory you can use is .. / data. The full path is stored in the environment variable $ OPENSHIFT_DATA_DIR. However, this directory is not publicly accessible, so the URL does not lead.
The solution is quite simple - just create a symbolic link. Here is an example for PHP. Log in via SSH and run:
mkdir app-root/data/photos cd app-root/repo/php # php/ is the only publicly accessible directory (by default, not sure if not changeable in .htaccess). ln -s ../../data/photos photos
This makes the content in .. / data / photos publicly available at http://myapp-myaccount.rhcloud.com/photos/ . The directory for managing files can be referenced in $_ENV['OPENSHIFT_DATA_DIR'] .
source share