Java web application, file upload not happening in the server

We recently hosted a web application in an ubuntu server and found that file upload was not happening. After googling
for a while this is what we found.

1. Navigate to parent folder of the folder or directory created for storing uploaded images.
2. Enter command ls -lsh in terminal.
3. Check who is the owner of the directory of folder created. In case if you haven't created a folder please do it. and then do the checking.
4. Probably it will be root or the user with which you created the folder.
5. Go to the tomcat directory location and again type the ls -lsh command and see who owns the directories there?
6. If it is tomcat 6 version, the owner might be tomcat6 user and similary a tomcat user for other versions.
7. This difference is reason for the file upload not happening.
8. All you have to do is change the owner of the upload directory of folder to respective tomcat user. It should work fine from then.

No comments:

Post a Comment