• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

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
 
Saloon Keeper
Posts: 14692
330
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic