• 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
dispatchRequest not seeing InputStream data from uploadFile request
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dispatchRequest not seeing InputStream data from uploadFile request


  • Subject: dispatchRequest not seeing InputStream data from uploadFile request
  • From: Carlos Maldonado <email@hidden>
  • Date: Fri, 31 Jul 2009 13:49:38 -0700

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.

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

  • Follow-Ups:
    • Re: dispatchRequest not seeing InputStream data from uploadFile request
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Ant build in WO 5.4 not working (Windows)
  • Next by Date: Re: dispatchRequest not seeing InputStream data from uploadFile request
  • Previous by thread: Dependent popUp with D2W
  • Next by thread: Re: dispatchRequest not seeing InputStream data from uploadFile request
  • Index(es):
    • Date
    • Thread