Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9112803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:49:22+00:00 2026-06-17T03:49:22+00:00

I’ve got a file upload JSP that was working, but now is not. It’s

  • 0

I’ve got a file upload JSP that was working, but now is not.
It’s not working now after our server was replaced and software was updated (tomcat5 to tomcat6, etc.).
Here’s the code:

FileOutputStream fileOut = new FileOutputStream(savePathFile);
fileOut.write(dataBytes, startPos, (endPos - startPos));

The file is created with the first line, new FileOutputStream(…), (filesize is 0), but the second line, .write, throws an exception. The file’s owner/group is tomcat/tomcat.

So it seems tomcat should have the right permissions.
I also looked at tomcat java permission policies (catalina.policy) to see if there were the correct FilePermissions. They were not there, so we added:

grant codeBase "file:${catalina.home}/webapps/myapp/-" {
permission java.io.FilePermission "/var/lib/tomcat6/webapps/myapp/photographs", "read, write";
}

But it didn’t make a difference. Then I was told that tomcat was not being started with the security option enabled.

tomcat6.conf:SECURITY_MANAGER="false"

I’m not sure where else I should look. I have a few explicit questions:

How can I see what permissions (rwx) the user tomcat actually has on this directory?

How can I verify that tomcat is or is not running with the security options enabled?

For the permission, should it read:

grant codeBase "file:${catalina.home}/webapps/myapp/admin/-" {

since the upload.jsp file is in webapps/myapp/admin directory?

Thank you for any help,
Frank

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:49:24+00:00Added an answer on June 17, 2026 at 3:49 am

    I solved the issue – it had to do with the way the multipart data was parsed. I’m not sure why that changed withe the new server, perhaps character encoding, but i changed my code and it’s working. Thanks all for you comments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a file upload field (attachment1) in a form that may or may
I've got a small file upload system on my Django website that uses their
I've got a form that allows a file upload and I'm using data validation
We have got an extjs 3.1.1 form with file upload field ( http://www.extjs.com/deploy/dev/examples/form/file-upload.html from
I got this traceback when trying to upload a file using put_file (source code
on master file got ... <div id=nav-main> <asp:Menu ID=Menu1 runat=server DataSourceID=SiteMapDataSource1 Orientation=Horizontal Width=573px CssClass=menu-main
I want to develope upload and download file from server. Upload.html <form action=/UploadFile/UploadFile method=POST
I have a file upload button on my MVC view. After the file is
hi i got list of warning regarding file size when i try to upload
I've got some PHP code that'll create a new file in a set directory:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.