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

Issue with Uploading files in IE

1 Answer 109 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
mohmedsadiq modan
Top achievements
Rank 1
mohmedsadiq modan asked on 21 Jun 2012, 07:59 AM
Hello,

I have added Async file upload control in page and set display as none. like
<telerik:RadAsyncUpload ID="fuImport" runat="server" HttpHandlerUrl="~/CustomHandler.ashx"
         OnClientFileUploaded="onClientFileUploaded"  PersistConfiguration="true"
         MaxFileInputsCount="1"
         MultipleFileSelection="Disabled" OnClientFileSelected="CheckExtension"
         CssClass="jImport" OnClientAdded="onClientAdded" Style="display: none">
</telerik:RadAsyncUpload>
I have disabled embeded scripts in web.config
<add key="Telerik.EnableEmbeddedScripts" value="false"/>
for this I Have used custom handler HttpHandlerUrl="~/CustomHandler.ashx".

Now I have opened file dialog from menu client click(ImportData()  function ) instead of clicking on select button of file upload. Script are as below.
var $fileInput;
function onClientAdded(sender, args) {               
    if (sender.get_id() != undefined && sender.get_id() == 'fuImport') {                   
        //get file control instance from telerik upload control.
        $fileInput = $(".jImport").find(".ruFileInput");                   
 
    }
}
 
//check selected file is valid or not.
function CheckExtension(radUpload, eventArgs) {
    var input = eventArgs.get_fileInputField();               
    var fileExtension = input.value.substr(input.value.length - 3, 3);
    if (fileExtension != "xml") {
        alert(input.value + " does not have a valid extension.");
        radUpload.deleteFileInputAt(0);           
    }               
}
 
function ImportData()
{
    if ($fileInput != null) {
        //open dialog box for file selection.
        $fileInput.click();
    }  
}
function onClientFileUploaded(sender, args) {
    //check file is uploaded properly then perform import process.
    if (sender.getUploadedFiles().length > 0) {
        $(".jImport").css('display', 'none');
        $('.jImportButton').click();
    }
}
Now when we call ImportData function then file dialog is opened to select the file, after selecting file, upload process is not processing file for upload in IE, when I see this in IE Developer tool Network tab it's below url is executed multiple time
http://localhost/enigma/Telerik.RadUploadProgressHandler.ashx?AsyncProgress=true&RadUrid=3177d972-edfc-4992-aeee-1a1bbc50cdc50&_=1340265308915
RadUrid
changed in every request.

If I test same in FF and Chrome then it's worked perfect. Also If I set Display : block to file upload control and then upload files clicking on select button of file upload in IE then it's worked perfect.

Note : My site is hosted in Shared hosting server so I am not able to add handler in web.config.

Kindly Help me to resolve this issue.

Thanks in Advance.
Mohmedsadiq Modan

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 25 Jun 2012, 08:07 AM
Hi,

This is a known limitation of IE. You can read more about this in the following forum topic:
http://www.telerik.com/community/forums/aspnet-ajax/async-upload/select-file-while-click.aspx 
 
All the best,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
mohmedsadiq modan
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or