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

Preview Image Before Upload

1 Answer 53 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 06 Oct 2008, 09:17 PM
The Telerik help files show the following code for previewing an image prior to upload:

<script type="text/javascript">  
function OnClientFileSelectedHandler(sender, eventArgs)  
{  
   var input = eventArgs.get_fileInputField();  
   //check the extension  
   if (sender.isExtensionValid(input.value))  
   {  
       var img = document.getElementById('<%= Image1.ClientID %>');  
       if (img)  
       {  
           img.style.visibility = "";  
           img.src = eventArgs.get_fileInputField().value;  
       }  
   }  
}  
</script> 

unfortunately this does not work with Firefox. The get_fileInputField().value stips out all path info in Firefox leaving just the filename.

Is there a workaround for this?

Thanks,

Mark

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 07 Oct 2008, 07:46 AM
Hi Mark,

This limitation is described in the help topic and there is no workaround for this yet.

Kind regards,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Upload (Obsolete)
Asked by
Mark
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or