Async Upload with additional fields

4 posts, 1 answers
  1. OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 09 Oct 2012 Link to this post

    I'm trying to upload a file to a document in CouchDB.
    To do so, I need to provide the document identifier as part of the url AND a revision as an additional field. This is not a problem if I'm submitting a form with both inputs (revision and file) but I wonder if it is possible with asynchronous upload do something similar. Is it? How? 
  2. Answer
    Dimo avatar
    8407 posts

    Posted 11 Oct 2012 Link to this post

    Hi Emiliano,

    Unfortunately the Upload does not support the described behavior, i.e. it cannot send additional data to the server. You should use the widget's events and post the other fields manually.

    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. David
    David avatar
    2 posts
    Member since:
    Feb 2012

    Posted 18 Oct 2012 Link to this post

    I'm not exactly sure what you're asking, but I am sending two drop down values with my async upload by attaching them to the saveUrl.

        async: {
            saveUrl: "save",
            autoUpload: true
        upload: function (e) {
            e.sender.options.async.saveUrl = "save?t=" + $("#t").val() + "&q=" + $("#q").val();
    $("#files").data("kendoUpload").options.async.saveUrl = "save?t=" + $("#t").val() + "&q=" + $("#q").val();

    Something like that.
  4. Daniel Probst
    Daniel Probst avatar
    5 posts
    Member since:
    Jan 2010

    Posted 22 Nov 2012 Link to this post

    The same works quite well using Razor:
     .Async(a => a.Save("Save", "Media", new { dir = "bla" })
      .Remove("Remove", "Media")

    and here's the controller:
    public ActionResult Save(IEnumerable<HttpPostedFileBase> files, string dir)
Back to Top