Access to the download file at $ OPENSHIFT_DATA_DIR
I have uploaded some images to a folder $OPENSHIFT_DATA_DIR/uploaded
, but I cannot find these files using:
$_ENV['$OPENSHIFT_DATA_DIR'].'uploaded/filename.jpg';
The error message was something like this:
The requested URL / var / lib / openshift / xxxxx / app-root / data / thumbnails / filename.jpg was not found on this server.
But when I ssh into my openhift app , there was a file in$OPENSHIFT_DATA_DIR/uploaded/
Is there a specific command to extract information from $OPENSHIFT_DATA_DIR
?
***** ***** edited
So, I did some further research online and apparently the folder is $OPENSHIFT_DATA_DIR
not available. One way to get around is to create a symbolic link. However, another problem arises: I could not symbolize $OPENSHIFT_DATA_DIR/uploaded
and $OPENSHIFT_REPO_DIR/src/img/uploaded
. The command I used was:
ln -s ${OPENSHIFT_DATA_DIR}uploaded ${OPENSHIFT_REPO_DIR}src/img/uploaded
But when I check it using readlink
:
readlink -f ${OPENSHIFT_REPO_DIR}src/img/uploaded
it still displays the folder ${OPENSHIFT_REPO_DIR}src/img/uploaded
instead$OPENSHIFT_DATA_DIR/uploaded
source to share
So the solution was pretty simple: set the .openshift/action_hooks/build
file to "executable" . A symbolic link to $OPENSHIFT_REPO_DIR/src/img/uploaded
can then be specified in the assembly file and the loaded files can then be invoked by calling$_ENV['$OPENSHIFT_REPO_DIR'].'src/img/uploaded/filename.jpg';
source to share