java - Access files outside the Webcontent folder -


i have made folder outside webcontent save uploaded images user. tried access files directly passing location in "src" tag unable fetch it. after researching found have set path using in "conf/server.xml" file inside tag. although have made these changes unable access file.

1)my tomcat installed @ e:\my work\tomcat

2)i having webroot @ e:\my work\project

3)image folder @ e:\my work\images

path setting in "conf\server.xml" is

    <host name="localhost"  appbase="webapps"         unpackwars="true" autodeploy="true"         xmlvalidation="false" xmlnamespaceaware="false">    <context docbase="/my work/images/" path="/images"  />    </host> 

but still when tried access file using following url

           http://localhost:8080/images/paper.jpg 

i unable fetch , getting "http status 404" , request resource not found error.

please me in using blob feild store image , storing image inside folder when user request particuler image. don't want use specific servlet write image browser rather want direct access user.

please me solve problem. regard

add <context> tomcat/conf/server.xml file.

<context docbase="c:\images" path="/project/images" /> 

in way, should able find files (e.g. c:/images/nameofimage.jpg) under:

http://localhost:8080/project/images/nameofimage.jpg


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -