andy007
andy007

Reputation: 917

OpenShift: upload file to server

This OpenShift webapp uses Tomcat7 and sevlets.
Upload File Path from servlet is:

String uploadFilePath = System.getenv("OPENSHIFT_DATA_DIR")+"uploads/";

/var/lib/openshift/53d4da604382ecdd4f000005/app-root/data/uploads/

How to find this file on the server?

http://webapplication.rhcloud.com/uploads/4567.JPG

http://webapplication.rhcloud.com/var/lib/openshift/53d4da604382ecdd4f000005/app-root/data/uploads/4567.JPG

but response is: The requested resource is not available.

Upvotes: 0

Views: 1338

Answers (1)

user2879327
user2879327

Reputation:

Your OPENSHIFT_DATA_DIR is not publicly available by default. Try looking through this forum post that talks about how to upload/view files using java on OpenShift: https://www.openshift.com/forums/openshift/how-to-upload-and-serve-files-using-java-servlets-on-openshift

Upvotes: 2

Related Questions