On Wednesday, November 20, 2013 4:15:58 AM UTC+1, Vinny P wrote: > > On Tue, Nov 19, 2013 at 9:40 AM, Rich <[email protected] <javascript:>> > wrote: >> >> This seems to be working fine on the Dev Server but *not* on the live >> AppEngine. >> >> > > Can you use *HttpServletRequest.getHeaders* and inspect the headers > you're receiving on your servlet? See > http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getHeaders(java.lang.String). > > Specifically, check the *content-type* that the request is declaring. >
The content-type looks correct: Content-Type: multipart/form-data; boundary=90e6ba181bd4c20dbe04eb989025 All other headers (cookies, user agent, etc) are also being passed through correctly. > > On Tue, Nov 19, 2013 at 9:40 AM, Rich <[email protected] <javascript:>> > wrote: > >> Note, that the blobs are still retrievable >> with blobstore.get{File,Blob}Infos(req), but I cannot access the additional >> data that was sent with the request. >> >> > > What specifically is this additional data? How is it formatted, what it > looks like, etc. Can you describe what *myExtraData* in your code example > represents? If you're speaking about the metadata describing the file, > that's available through the *BlobInfo* class. If you're talking about > standard parameters, that's available through *getParameter(key)*. > The additional data in my real app is a chunk of JSON data that describes additional updates that should be applied to the resource to which the blob is being added. The code snippet I posted above was a stripped down version that reproduced the problem with just a trivial bit of additional data. > > If there is any additional data in the request, you may be able to find it > by inspecting the raw request data. Call *getInputStream()* on the > request and print out the stream. > The input stream is empty: request.getContentLength() returns -1 and the first call to inputStream.read() returns -1. Note that if I post _directly_ to this servlet, instead of the blobstore upload URL, everything looks fine: I can read the input stream and it is a nice, well-formed multipart; and I can access the parts perfectly using ServletFileUpload. The blobstore handler in the production instance is clearly stripping the data from the request and not passing it through as the docs describe. There is an interesting difference in the headers when comparing the direct upload and the upload going through the blobstore handler. When uploading directly the content-type is Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryNBSiBDlDexgiYbHL So the blobstore is not just truncating the mimeparts for the parts it cares about, it is completely rewriting the body of the request and using a different mime boundary. In the process it is losing the parts that* I*care about. :-( --- Rich > > ----------------- > -Vinny P > Technology & Media Advisor > Chicago, IL > > App Engine Code Samples: http://www.learntogoogleit.com > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-appengine. For more options, visit https://groups.google.com/groups/opt_out.
