We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Browse Button no action.

I am building webpage using uploader. my setup is .netcore 2.1 in razor page. I download sample from

But instead of using taghelp I want to create uploader in javascript.


Issue:
1. No action from clicking browser button in upload. 


1 Reply

NP Narayanasamy Panneer Selvam Syncfusion Team July 28, 2019 06:22 PM UTC

Hi Peng, 
Thanks for contacting Syncfusion support. 
We have checked your code snippet. The issue is raised due to the you have used ‘div’ element to render uploader. But we will render uploader in input element, Based on the input element’s file type and name attribute. 
Code snippet: 
    <input type='file' id='fileupload' name='UploadFiles' /> 
    <script> 
        var uploadObj = new ej.inputs.Uploader({ 
            asyncSettings: { 
                saveUrl: '<https://aspnetmvc.syncfusion.com/services/api/uploadbox/Save',> 
                removeUrl: '<https://aspnetmvc.syncfusion.com/services/api/uploadbox/Remove'> 
                }, 
            success: onUploadSuccess, 
            failure: onUploadFailure 
}); 
        uploadObj.appendTo('#fileupload'); 
        function addTokens(args) { 
            args.currentRequest.setRequestHeader('XSRF-TOKEN', document.getElementsByName('__RequestVerificationToken')[0].value); 
        } 
        function onUploadSuccess(args) { 
            if (args.operation == "upload") { 
                console.log("File Uploaded successfully"); 
            } 
        } 
        function onUploadFailure(args) { 
            console.log("File failed to upload"); 
        } 
    </script> 
 
 
Regards, 
Narayanasamy P. 


Loader.
Live Chat Icon For mobile
Up arrow icon