This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

File Upload using HTML + Servlet

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

i am developing one application in which i use simple HTML and at some placeses I am using Servlet.
But I am not able to upload file using servlet.

My code in doPost method
ServletFileUpload.isMultipartContent(request) // returns true

But



then it throws...
java.security.AccessControlException: access denied (java.io.FilePermission . write)


Please help me to solve this....
Thanks...
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like the servlet container is running with a security manager that doesn't allow the web app to access directory ".". Keep in mind that web apps do not have a default directory, and so "." will have a very different meaning than you may think it has. Try it with an absolute path that point to a directory within the web app; that is generally allowed by such security managers.
 
Sanket L Shah
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:It looks like the servlet container is running with a security manager that doesn't allow the web app to access directory ".". Keep in mind that web apps do not have a default directory, and so "." will have a very different meaning than you may think it has. Try it with an absolute path that point to a directory within the web app; that is generally allowed by such security managers.




Thank you so much...
I got my problem solved....
 
reply
    Bookmark Topic Watch Topic
  • New Topic