This is a migrated thread and some comments may be shown as answers.

Uploading to a cross domain WCF service

5 Answers 156 Views
Upload
This is a migrated thread and some comments may be shown as answers.
JAS J
Top achievements
Rank 1
JAS J asked on 14 Mar 2012, 01:24 AM
Hi all,

Here is what I am trying to do (unsuccessfully, I might add) and would appreciate any direction you can give me

From my Javascript kendo ui site, I want to upload a file to a cross domain WCF service that is hosted in Azure. 

In addition to uploading the files, I need to send additional parameters to the upload fucntion on the server

Is this possible to do?

Here is what my operationContract looks like:
[OperationContract]
[WebInvoke( Method = "POST",
UriTemplate = "/uploadmodeldata/?id={Id}&customerdatatype={customerdataType}&data={data}")]
void UploadModelData(string Id, string customerdataType, byte[] data);


How can I use the KendoUI upload widget to send files to this web service?

Do I trap the onUpload Event and call this? any ideas?


thanks,
Jas

5 Answers, 1 is accepted

Sort by
0
JAS J
Top achievements
Rank 1
answered on 15 Mar 2012, 02:21 AM
Any ideas? Anyone?
0
JAS J
Top achievements
Rank 1
answered on 16 Mar 2012, 05:42 PM
Still looking for help....
0
JAS J
Top achievements
Rank 1
answered on 19 Mar 2012, 08:59 PM
Can anyone help with this? I would be good to know that it cant be done...

thanks,
Jas
0
mo2011ti
Top achievements
Rank 1
answered on 06 Aug 2013, 05:59 AM
Hi JAS
do you find solution for this?
Thanks
Moti
0
T. Tsonev
Telerik team
answered on 09 Aug 2013, 12:44 PM
Hi,

Cross-domain uploads are governed by the standard CORS rules. The Azure service should set the following headers:
Access-Control-Allow-Origin: <your application domain>
Access-Control-Allow-Methods: POST
Access-Control-Allow-Credentials: true
(optional)

Additional data can be sent in the upload event. The query string can be used as an alternative by changing the saveUrl in the same event.

See this forum thread over at MSDN forums for generic information on handling multi-part form requests in WCF.

Regards,
T. Tsonev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
JAS J
Top achievements
Rank 1
Answers by
JAS J
Top achievements
Rank 1
mo2011ti
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or