My app runs on JBoss EAP and I want to upload images to the OPENSHIFT_DATA_DIR and then save their relative paths in the MySQL DB because I need to construct a path to the images and later serve them to the browser when needed.
If my OPENSHIFT_DATA_DIR
path is /var/lib/openshift/5364c54ce0b8cd80180001f7/app-root/data/
and I want schoolpics/federaluniversity/uniben-1/
inside it to save a file logo.png
such that the full path will be
/var/lib/openshift/5364c54ce0b8cd80180001f7/app-root/data/schoolpics/federaluniversity/uniben-1/logo.png
How to achieve this in term of storing in database, and opening using URL of image in a web page, since the OPENSHIFT_DATA_DIR
seems to be outside the webroot
of the app.