I seems that there is one more pitfall. When I tested my WOFileUpload script on another computer, it had some strange behaviour. The data and filePath bindings have not been stored after form submissions. The data binding was filled with an empty NSData object instead of null when nothing was selected...
I got this working correctly when I added

- WOUseLegacyMultipartParser true

as launch parameter.

Regards,

Helmut

Am 16.01.2007 um 10:38 schrieb Helmut Schottmüller:

Hi Matt,

you can find a solution in an older posting of Chuck Hill (http:// www.wodeveloper.com/omniLists/webobjects-dev/2003/September/ msg00455.html).
In short:

1. overwrite takeValuesFromRequest in your multipart form component:

public void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
        {
aRequest.setDefaultFormValueEncoding ( _NSUtilities.UTF8StringEncoding );
                super.takeValuesFromRequest(aRequest, aContext);
        }

2. overwrite the createRequest method in Application

        public WORequest createRequest(String aMethod, String aURL,
                        String anHTTPVersion, NSDictionary someHeaders, NSData 
aContent,
                        NSDictionary someInfo)
        {
WORequest newRequest = super.createRequest(aMethod, aURL, anHTTPVersion,
                                someHeaders, aContent, someInfo);
newRequest.setDefaultFormValueEncoding (_NSUtilities.UTF8StringEncoding);
                return newRequest;
        }

he also used the following overwrite in Application:

        public WOResponse dispatchRequest(WORequest request)
        {
                WOResponse response = super.dispatchRequest(request);

                String contentType = response.headerForKey("content-type");
if ((contentType == null) || (contentType.toLowerCase().indexOf ("text/html") > -1))
                {
                        
response.setContentEncoding(_NSUtilities.UTF8StringEncoding);
response.setHeader("text/html; charset=UTF-8; encoding=UTF-8", "content-type");
                }
                return response;
        }

This should do it. It works fine in my projects.
For more detailed information, please refer to Chucks original post.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to