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

Renaming file before async post

1 Answer 530 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Christina
Top achievements
Rank 1
Christina asked on 26 Apr 2013, 03:19 PM
Hi,

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.

Thanks,

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 29 Apr 2013, 11:15 AM
Hello,

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.

Regards,
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!
Tags
Upload
Asked by
Christina
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or