Read uploded csv file

Hello,
I'm using File Explorer control to upload csv file. 
After uploading I want to read the file in order to display a content in the Grid control.
What is the proper way to do this?
Thanks

1 Reply

PR Piramanayagam Ramakrishnan Syncfusion Team January 15, 2018 11:43 AM UTC

Hi Yuri, 
 
We would like to inform you that, after uploading any file in FileExplorer it will be displayed in Grid/Tile/Large Icons view. This is the default behavior of FileExplorer control. If you want to read file (.csv) instead of downloading when double click on it then, you need to customize it in application level by ‘before-open’ event in FileExplorer.  Please refer the below code example, 
 
[cshtml] 
<ej-file-explorer id="fileExplorer" path="wwwroot/css/images/FileExplorerContent" ajax-action="@Url.Content("FileActionDefault")" before-open="beforeopen"></ej-file-explorer>        
 
[Script] 
function beforeopen(args) { 
    if (args.itemType == "File" && (/\.(csv)$/i).test(this._selectedFile)) { 
        //write your own code to read .csv file 
    } 
} 
 
 
Please let us know, if you have any other queries. 
 
Regards, 
Piramanayagam R

Loader.
Up arrow icon