• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FileOutputStream exception

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i am doing application where i want to store file in images folder under my project directory. iam also changing the file name with attributes taken from seesion. I am taking context path using request.getContentType()
I am not able save the file using FileOutputStream

i am attching my code

I am ussing concat var to rename file .tts will be it extension
now i want to save this new file in images folder
but i get Exception





output

url===/Silicon_new/images
filename==jeetu@kpit.com 3.tts relative path==/Silicon_new/images java.io.FileNotFoundException: \Silicon_new\images (The system cannot find the path specified) done
--------------------------------------------------------------------------------
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. you are trying to open output stream for a folder, you did not append fileName to turl.

2. Try creating the directory "\Silicon_new\images" on your root directory and append the fileName to turl and run the app. You should see the file created properly. (I am sure this is not what you want, but your code trying to do this only).

3. you are trying to use context path as physical file path which is not possible. Read some docs on webapp folder structures and how webapp deployment works. Make sure you read your web-server specific docs, because they are vendor specific.
reply
    Bookmark Topic Watch Topic
  • New Topic