I have a file upload page that takes a file and parses it.
Order of Events
- user uploads file
- uploaded file gets copied
- copied file gets it’s encoding checked, with CPDetector
- determined encoding from the copied file is used to parse the original uploaded file
FileNotFoundExceptionon Solaris Test Server duringBufferedReadercreation.
- copied file is deleted
- uploaded file is parsed/verified
- parsed data is saved to a database
- uploaded file is deleted (I can’t remember if I’m doing this or Tomcat is.)
The Whole process works on my Windows 7 workstation. As noted above it does not work on my Solaris Test Server. Something(I Suspect Tomcat) is deleting the uploaded file before I can finish parsing it.
I’ve watched the directory during the process and an uploaded file does indeed get created, but it lasts less than a second before being deleted. Also It’s supposed to go into /opt/tomcat/ but seems be getting created in the /var/opt/csw/tomcat6/temp/ directory instead.
Thanks for any help
I realize it’s probably bad form to answer my own question like this but I wanted to leave this here in-case it helps someone else.
The Problem turned out to be How I was accessing the files.
I had hard-coded file paths, for windows, and Database loaded ones for the test server.
I switched those to using
System.getProperty("catalina.home")+"/temp/" + filenameI’m also copying the temp file a second time so I end up with:
Order of Events (changes are in bold)