"Not allowed to load local resource: file:///C:....jpg" Java EE Tomcat -


i'm trying retrieve picture file system after storage,(instead of putting in database copy disc , put path db)

  1. i had store picture c:\images\ folder , supposing name complete path c:\images\mypic.jpg
  2. when try retrieve set img src attribute <img src="c:\images\mypic.jps"> using java code
  3. in browser console found error not allowed load local resource: file:///c://images//mypic.jpg

question: how fix these path problem ? should store pictures ? , should retrieve them ?

sending tag <img src="c:\images\mypic.jpg"> cause user browser access image filesystem. if have store images in folder located in c:\images suggest create servlet images.jsp, parameter takes name of file, sets servlet response content image/jpg , loads bytes of image server location , put response.

but use create application? pure servlet? spring? jsf?

here can find info about, how it.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -