12 Dec 2011 9:37 AM #1
Unanswered: Large Amount of data to Remote Web Service
Sending a large amount of data to web service from Sencha Touch. Something that allows me to not send it through a query string? Can I send my data through the header instead?
I have a store setup using 'scripttag' and it works sending data to my web service when I remove some of the data out of my json. I can receive the data and see it in a variable in my web service. When I add the large text block back into my json, it fails with bad request. I plugged my json with all the data in it, into http://jsonlint.com/. It informs me that my json is well formed with the data being sent.
I'm open to alternate approaches, so here is how it is structured. I have 3 stores that hold offline data until the user is ready to upload the content to the server. It is my header information(similar to an order header), details (similar to items on an order) and a signature (using the signaturePad plugin in floating around on the Sencha Touch forums). I manually build a json record using these three stores. The signature data is raw, so it is a huge string which is the item causing the problem. I want to get that data up to the server where I will convert it to an image there instead of on the device.
I believe the problem I'm having is related to the allowed size of the querystring. Is there a way to send the data through the header with a large amount of data?
12 Dec 2011 1:26 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
If you are trying to load on a different domain (cross origin) then you are stuck with scripttag proxy and the params will be url encoded. The JSON must also be wrapped in a callback JS function that is pasted int he callback param.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.