• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Upload using HTML + Servlet  RSS feed

 
Sanket L Shah
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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...
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!