form submission from IOS app to Coldfusion not working

Posted on 2014-09-01
Last Modified: 2014-09-07
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?
Question by:theamzngq
    LVL 51

    Expert Comment

    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.
    LVL 2

    Accepted Solution

    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.
    LVL 51

    Expert Comment


    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.
    LVL 2

    Author Comment

    Got it, that makes sense.  I appreciate the input, I may run up against this some time down the road...
    LVL 2

    Author Closing Comment

    I used a workaround to solve the problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
    This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now