[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

form submission from IOS app to Coldfusion not working

I'm working with an IOS app developer and the app is submitting a form to my CF 9 server (running IIS 7.5) for processing.  The trouble is, CF is not able to interpret the form post correctly.  I made a test form page to test the form submission and it works just fine.  But when those same form fields are submitted from the IOS app, it comes across strange.  Compare the two attached files.  I dumped #form#, #url#, and #GetHttpRequestData()# for both a browser POST and the IOS app post.

form submission from IOS appform submission from browser form
In the browser form submission, everything looks neat and normal.  The IOS post seems to be encoded weirdly (or at least CF doesn't understand it).  Does anyone have any clue when the IOS post is being so weirdly interpreted by CF?
0
David Williamson
Asked:
David Williamson
  • 3
  • 2
1 Solution
 
_agx_Commented:
Seems like CF is having trouble parsing the data sent from IOS.  What does the raw GetHttpRequestData()  "content" value look like? Use <cfoutput> and <pre> tags to show the new lines.

I'm wondering if the file upload might be the problem.  Try a simple form - without any file uploads.
0
 
David WilliamsonIT DirectorAuthor Commented:
The screenshots are showing a dump of the GetHttpRequestData() structure; the content value is there as well.  The form submission without the file does the same kind of thing.  The way IOS is sending the form data seems "non-standard" somehow.

Though I would like to understand this issue, I was under a deadline and had to move on.  We switched to having the app submit the data using JSON and encoding the image to a base64 string.  On the CF side I used ImageReadBase64() to write the string back to an image to the server's hard drive. That worked fine.
0
 
_agx_Commented:
EDIT:

Ok. Then probably best to delete this question or mark your work around as the answer.  BUT to clarify a few misconceptions about the cfdump ...

>> The way IOS is sending the form data seems "non-standard" somehow.

The main reason it looks a little different is because CF isn't really showing you the actual raw submission  in the 2nd dump. That's a cleaned up/human friendly version - AFTER the raw content was parsed. That's not what the raw <form> post actually looks like.

>> The screenshots are showing a dump of the GetHttpRequestData() structure

Yes, but that's html formatted which doesn't show white space. White space is very significant when parsing. There are rules for how the post data must be formatted. A certain number new lines is required in certain spot. Otherwise it's not "valid" from the parser's perspective.  You can't see any of that from the cfdump. That's why I asked to see the raw value displayed within <pre> tags.
0
 
David WilliamsonIT DirectorAuthor Commented:
Got it, that makes sense.  I appreciate the input, I may run up against this some time down the road...
0
 
David WilliamsonIT DirectorAuthor Commented:
I used a workaround to solve the problem.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now