Hello,
I have added Async file upload control in page and set display as none. like
I have disabled embeded scripts in web.config
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.
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
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
>
<
add
key
=
"Telerik.EnableEmbeddedScripts"
value
=
"false"
/>
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();
}
}
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