• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: dispatchRequest not seeing InputStream data from uploadFile request
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dispatchRequest not seeing InputStream data from uploadFile request


  • Subject: Re: dispatchRequest not seeing InputStream data from uploadFile request
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 31 Jul 2009 14:10:26 -0700


On Jul 31, 2009, at 1:49 PM, Carlos Maldonado wrote:

Hi,

I'm debugging an app and can't find the exact cause of loosing the contents of a file being uploaded. I know WO is capable of uploading files, that's not the issue, even I tested using XCode with WO5.3 in Tiger, Eclipse with WO5.4 in Leopard and finally using Eclipse with WOnder 5.4 in Leopard. All worked with no problems. If I needed to grab the file contents I could do it either in createRequest, dispatchRequest or in the DA method or the action object-method in case I wanted not to use DAs.

But then I moved to the non-working app and I can see file contents in createRequest method --I can even save the file-- but as soon as execution gets to dispatchRequest, and though I get a valid object when I issue the call InputStream input = part.formDataInputStream(); --input is valid object-- I don't get any data from the call input.read(buffer, offset, length - offset); or input.available() all I get is a -1 which means there's no data.

I don't have an awake method, that I think is the next method in execution after createRequest gets called and before dispatchRequest gets called too.

Does anybody had experienced something simliar? or have a clue of what could be causing to loose data?. I checked the encoding for the WOComponent and is set to UTF-8, so defaultFormValueEncoding=UTF-8 and formValueEncoding=UTF-8 are the same.

I'm not sure where, but I think the encoding is getting changed. Are you using Wonder in this app? If yes, add this to the Properties file:


er.extensions.ERXApplication.DefaultEncoding= UTF-8


Chuck


Here's the request that doesn't upload, see if someone can see it different from "normal":
<com.webobjects.appserver.WORequest (<com.webobjects.appserver.WORequest httpVersion=HTTP/1.1 headers={accept=[application/xml,application/xhtml+xml,text/ html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5], accept- encoding=[gzip, deflate], accept-language=[en-us], connection=[keep- alive], content-length=[14000], content-type=[multipart/form-data; boundary=----WebKitFormBoundaryZ5DtuOIpu8QIP+zn], host=[localhost: 11021], origin=[http://localhost:11021], referer=[http://localhost:11021 /cgi-bin/WebObjects/LSDesktopServer.woa/wa/uploadFile], user- agent=[Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.19.2 (KHTML, like Gecko) Version/4.0.2 Safari/ 530.19]} content-length=0 cookies=null userInfo={} storePageInBacktrackCache=true >) method=POST uri=/cgi-bin/ WebObjects/LSDesktopServer.woa/wa/uploadPenDataMetrics? filePathToUpload=/tmp /Hola.java&userToken=090749684221rSHxwWRjQjhN defaultFormValueEncoding=UTF-8 formValueEncodingDetectionEnabled=NO formValueEncoding=UTF-8 formValues={1.0.mimetype = ("application/ octet-stream"); 1.0.filename = ("Hola1.java"); 1.0 = ( <class com.webobjects.appserver._private.WOInputStreamData (stream com.webobjects.appserver.WOMultipartIterator$WOFormData $_WOFormDataInputStream@7689bc of length 0), has NOT been accessed> ); } >



-Carlos _______________________________________________ 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

-- Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific 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
References: 
 >dispatchRequest not seeing InputStream data from uploadFile request (From: Carlos Maldonado <email@hidden>)

  • Prev by Date: dispatchRequest not seeing InputStream data from uploadFile request
  • Next by Date: [OT] Really quick WebObjects-Cocoa Touch crossover question
  • Previous by thread: dispatchRequest not seeing InputStream data from uploadFile request
  • Next by thread: [OT] Really quick WebObjects-Cocoa Touch crossover question
  • Index(es):
    • Date
    • Thread