This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

JavaMail File Attachment Security problem

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all,
Problem: I have written a jsp which sends e-mail (SMTP Protocol). It also has a file upload field which allows the user to attach a file to the message. This works when i run the jsp in my local machine. However, when i have uploaded the jsp to my server at www.jwebhosting.net it gives me an exception..sth like FileSecurityEception (can't remember it off my head but I think you will understand). Basically, Java seems to think that the JSP is not allowed to browse and upload any file from the user's machine because it considers this as a security violation.
How do I get over this? Where do I set the security settings? Please help.
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, sorry, I do not understand. Exceptions and their stack traces contain vital information that will help diagnose the problem. My best suggestion for now is that an attempt to write the upload to a temporary file might be failing.
- Peter
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay Peter, here is the message that I'm getting from my error page:
(java.io.FilePermission D:\Ernie's Data\Swaziland Links For My Site.doc read).
I was trying to upload the file from my ssystem. Please try the jsp out from www.ernieboy.com/SendMail.jsp and you will see what I mean.
Thanks
 
Alas, poor Yorick, he knew this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!