• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

server directories  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

first of all sorry for asking such an easy question , but it is bugging me for a long time..

actually i am building a web application in which user has the ability to upload his images under directory

web-inf
-->images

now these images can be viewed online bcz they are under web-inf...but the problem is i am working on production server and i have to replace the war after some changes or bug fixing. what ever images user has uploaded will be deleted as i replace the war..

if i save these images outside the server then . obviously i cant access them online...only if i copy them back in web-inf again and then give link to user..

can anybody suggest me what should b the suitable solution for this problem-..and i dont want to store images in database.. :-)
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure you can--stream the images to the user with a servlet (or whatever back-end technology you're using).
 
Asad Kazmi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually . !
let me explain you the whole scenario...i dont want to save image under
webinf/images/
..because i am continuously updating and war file by replacing it..if i store image in image folder then what ever is in that folder will be deleted when i will replace it with the new one.......so what i did, i place images in some other folder say
c:/userUploadedImage
now i want to show the stored image to the online user in html image tag.....
....as you can understand..the image stored at c:/... cant be shown online.....right ?
so what i am doing is that i am copying the requested image from c:/... to webinf/images. when user need that image to view it....
that might sound bad...
but this was quiet easy to implement...and the servlet approach doesnt fits in the scenario anywhere... ??? perhaps may b i am missing some thing...
 
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Asad Kazmi wrote:web-inf
-->images


WEB-INF, not web-inf.

can be viewed online bcz they are


Please use real words when posting to the forums. Abbreviations such as "bcz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66806
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Asad Kazmi wrote:and the servlet approach doesnt fits in the scenario anywhere... ??? perhaps may b i am missing some thing...



Again, real words please. And proper punctuation and capitalization. Programming is all about attention to detail and accuracy. Please show the same care in your posts that you would show in your code.

Yes, you are missing something. The servlet can read the image file anywhere off the file system and stream it as the response.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!