Renaming file before async post

2 posts, 0 answers
  1. Christina
    Christina avatar
    4 posts
    Member since:
    Nov 2012

    Posted 26 Apr 2013 Link to this post


    Is there a way of changing the filename of a file (within the Javascript)  that is about to be posted asynchronously? For example I have tried in the select method of the upload tool, the following:

    "select": function (e) {
              e.files[0].name = "changed_named.jpg";

    However, when the file reaches my MVC controller action, the HttpPostedFileBase object has the original filename. I've also tried doing this in the 'upload' event with no luck.

  2. T. Tsonev
    T. Tsonev avatar
    2830 posts

    Posted 29 Apr 2013 Link to this post


    The name field is listed as read-only in the specification. My suggestion is to send the desired name as metadata and use it in the controller.

    I hope this helps.

    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top