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

Javascript Event Handlers

1 Answer 43 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Justin McMillen
Top achievements
Rank 1
Justin McMillen asked on 14 Sep 2009, 03:38 PM
Hi,
 I was wondering if someone could tell me how to access the name of the uploaded file with javascript.  I have the following javascript code:

function onLoad(){
    var slCtl = document.getElementByID("Uploader");

    slCtl.Content.Uploader.FileUploaded = FileUploaded;
}

function FileUploaded(sender, args) {
   var fileName = args.SelectedFile.Name;
}

When I upload a file, I get an error message saying "Object doesn't support the property or method...". 

In reading the documentation, I see that the RadUploadEventArgs object has a SelectedFile property which has a Name property.  What am I doing wrong?

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 17 Sep 2009, 05:02 PM
Hello Justin,

I apologize for the late response - we just released the beta of our Q3 controls.

Your code looks pretty good. Unfortunately the RadUploadSelectedFile type is not scriptable and you can not access the file's name. In order to accomplish your task you should call a javascript method from the Silverlight code with the name of uploaded file.

Attached you can find a demo project. Please give it a try and let us know if you have more questions.

All the best,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Upload
Asked by
Justin McMillen
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or