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: Helge Städtler <email@hidden>
- Date: Tue, 26 Jul 2005 09:07:18 +0200
I wonder if this code you pasted here really ever compiled... because you
will at least have to declare in the method "uploadFile" some statement like
"throws Exception" right, or does NSForwardException not need this statement
(do not know this at the moment exactly)?
I would just have a closer look to the stacktrace of the exceptions thrown.
Maybe you have a permissionsproblem.
having <drwxrwx--x 27 baiss admin 918 Jul 22 13:53 Flyers>
may work well for development if user "baiss" is opening xCode. but in
deployment if the "appserv"-user is running the application this may become
a problem. generally WO apps in deployment seem to run with the rights by
whom "wotaskd" is owned. so if "root" is owner of "wotaskd" it will run with
root-rights and in this case ANY permission-problem will disappear
(downside: you will have to know what you do, but this is valid anyway...).
for me it strongly looks like a permissions problem (new server = new
users/setup)... try uploading to the /tmp/ - directory this is in any case
accessable.
regards,
helge
Am 26.07.2005 0:16 Uhr schrieb "Baiss Eric Magnusson" unter <email@hidden>
/ On 26.07.2005 0:16 Uhr "Baiss Eric Magnusson" wrote using address
<email@hidden>:
> 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;
> }
_______________________________________________
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