Preview Image Before Upload

Thread is closed for posting
2 posts, 0 answers
  1. Mark
    Mark avatar
    7 posts
    Member since:
    Feb 2008

    Posted 06 Oct 2008 Link to this post

    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.src = eventArgs.get_fileInputField().value;  

    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?


  2. Veselin Vasilev
    Veselin Vasilev avatar
    2992 posts

    Posted 07 Oct 2008 Link to this post

    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.
Back to Top