Uploading to a cross domain WCF service

6 posts, 0 answers
  1. JAS J
    JAS J avatar
    39 posts
    Member since:
    May 2010

    Posted 13 Mar 2012 Link to this post

    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

  2. JAS J
    JAS J avatar
    39 posts
    Member since:
    May 2010

    Posted 14 Mar 2012 Link to this post

    Any ideas? Anyone?
  3. Kendo UI is VS 2017 Ready
  4. JAS J
    JAS J avatar
    39 posts
    Member since:
    May 2010

    Posted 16 Mar 2012 Link to this post

    Still looking for help....
  5. JAS J
    JAS J avatar
    39 posts
    Member since:
    May 2010

    Posted 19 Mar 2012 Link to this post

    Can anyone help with this? I would be good to know that it cant be done...

    thanks,
    Jas
  6. moti
    moti avatar
    27 posts
    Member since:
    May 2011

    Posted 06 Aug 2013 Link to this post

    Hi JAS
    do you find solution for this?
    Thanks
    Moti
  7. T. Tsonev
    Admin
    T. Tsonev avatar
    2771 posts

    Posted 09 Aug 2013 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready