Re: 10.4 and new File now longer works for uploading a file
Re: 10.4 and new File now longer works for uploading a file
- Subject: Re: 10.4 and new File now longer works for uploading a file
- From: Chuck Hill <email@hidden>
- Date: Tue, 26 Jul 2005 09:52:49 -0700
Try this:
sudo -u appserver touch /Library/WebServer/Documents/nwsufis/Flyers/
Tarball.txt
If it gives you a permissions error you know where to look for the
problem. As a rough guess you need to
sudo chown root:admin Flyers
Chuck
On Jul 25, 2005, at 3:16 PM, Baiss Eric Magnusson wrote:
I have found out that the file uploading logic is no longer working
with the new server and I am having trouble trouble-shooting the
problem.
The following folder exist with permissions on the server
<drwxrwx--x 27 baiss admin 918 Jul 22 13:53 Flyers>
I have the following code which used to work...
public WOComponent uploadFile() {
if ( actualFilePath == null || actualFilePath.length() <= 0) {
throw new NSForwardException( new Exception
("actualFilePath was null, or there were zero bytes in the file,
when the uploadFile button was clicked. "), "uploadFile" );
}
try {
File uploadedFile = new File( actualFilePath );
bytesWritten = uploadedFile.length();
if ( bytesWritten <= 0 ) {
throw new NSForwardException( new Exception
("bytesWritten is zero or less. To-> " + actualFilePath), " ***
uploadFile ***" );
}
} catch ( Exception e ) {
throw new NSForwardException( e, "An exception was
thrown when trying to <uploadFile>. " + e.toString() );
}
return null;
}
But now I get my own exception...
Error:java.lang.Exception: bytesWritten is zero or less. To-> /
Library/WebServer/Documents/nwsufis/Flyers/Tarball.txt
If you have read this far you can see that the input file
<actualFilePath> as selected by the user is present and has bytes
in it and the file path on the server looks good and <new File>
doesn't throw any exception of its own.
Is there some other high order permissions that needs to be set on
a new server?
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden