File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes JavaMail File Attachment Security problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "JavaMail File Attachment Security problem" Watch "JavaMail File Attachment Security problem" New topic
Author

JavaMail File Attachment Security problem

ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
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.


In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
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

Joined: Aug 27, 2001
Posts: 216
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
 
IntelliJ Java IDE
 
subject: JavaMail File Attachment Security problem
 
Threads others viewed
Reading and manipulating file content on client machine
wanted to impement file uploading
File upload only handles .txt documents??
My Servlet has no permission to upload files...please help
Opening file from remote machine using authentication
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture