Okay, the new WOFileUpload is starting to really make me mad. It seems to
be incredibly buggy. Here's what appears to me to be a bug. I would much
appreciate it if someone else could confirm it.
I am running on Solaris. The process is running as the user 'webob'.
There
is a directory, /usr/local/apache/htdocs/. Now, /usr, /usr/local/, and
/usr/local/apache are NOT writeable by the 'webob' user. However,
/usr/local/apache/htdocs/ IS writeable by the webob user. If I use
java.io.File.createNewFile() I can succesfully create a file inside
/usr/local/apache/htdocs without any problems at all----in my same test
app, running as the user 'webob'.
However, WOFileUpload refuses to upload there. If I instruct it to upload
there, after the upload the 'finalFilePath' binding is set to a path in the
/var/tmp directory, and indeed this is where I find the file. No exceptions
are generated, and even turning on FULL debugging with NSLog, no debug
messages are generated at all! There is definitely no conflict with an
existing file--I am making sure to try file paths that do not already have
a file there.
If instead I try to upload a file to a directory where the 'webob' user has
write permissions to every single directory along the path (for example,
/var/tmp), then the upload works as expected, and the finalFilePath matches
my chosen streamToFilePath binding exactly. This is what makes me suspect
that WOFileUpload is eroneously refusing to upload a file to a directory
unless the process has write permissions on EVERY directory in the
filepath. This is not how unix permissions work though, I don't need write
permissions like that to write to the actual leaf directory, and I can use
java.io.File to write there myself without a problem.
So if anyone can confirm this, that would be great. But WOFileUpload is
really starting to enfuriate me. I had already encountered three to four
bugs that were not show stoppers, that I was able to work around. But this
one is a show stopper. I can not easily work around it without
compromising the security of my server. This is stupid. I am not
confident about the thoroughness that Apple tests this stuff before sending
it out the door. I feel like I should be getting paid by Apple for spending
my time finding these bugs; but the real problem is that I can't get my app
to work properly. I really need the streaming API provided in 5.2.