简体   繁体   中英

image can not load using openshift cloud server

I using openshift cloud server to host my web-app. I am uploading image into the 'app-root/data/photos/' directory using path variable. Its working properly.

$path=$_ENV["OPENSHIFT_DATA_DIR"].'photos/'.$photo_name;

But when i reloaded that saved image in my web-app using same path, it is not loaded.

<img src="{{$_ENV["OPENSHIFT_DATA_DIR"].'photos/'.$photo_name}}" height="250px" width="250px"/>

what am i do to load that image??

The app-root/data directory is not public by default (no web access).

You can create a symlink to overcome this as outlined here: https://community.jboss.org/people/ozizka/blog/2013/01/06/openshift--how-to-make-uploaded-files-public

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM