• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

loaded image is not showing on page in Spring mvc application

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys

I'm developing upload profile pic functionality in Spring mvc application,
while upload image, it is saving in my local directory, now I set image path from local machine
it does not show image, in firebug it shows failed to load the given Url.
and my image source path looks like
<img width="100" height="100" alt="Upload Image" src="C:\test111\Desert.jpg" style="border-color: red; border: 1px solid;">

please suggest me solution why is not showing image on page,

thanks
 
Bartender
Posts: 15735
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you're uploading an image to a server, and then the server generates HTML containing a path to a local file on the server?

HTML is rendered by a browser, and this is done on a client machine. You can't use local paths to link to files on a server.

A solution is to upload the images to the public folder of your web-application, and then generate links that are relative to your application.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic