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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Browse Button no action.

Thread ID:

Created:

Updated:

Platform:

Replies:

146211 Jul 25,2019 07:40 PM UTC Jul 28,2019 06:22 PM UTC ASP.NET Core - EJ 2 1
loading
Tags: File Upload
Peng Xie
Asked On July 25, 2019 07:40 PM UTC

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. 


Narayanasamy Panneer Selvam [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon