File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -720,14 +720,22 @@ export class DataPreview {
720720 * @param fileType Data file type.
721721 */
722722 private async saveData ( fileData : any , fileType : string ) : Promise < void > {
723- let dataFilePath : string = this . _uri . fsPath . replace ( this . _fileExtension , '' ) ;
723+ let dataFileName : string = this . _fileName . replace ( this . _fileExtension , '' ) ;
724724 if ( this . _dataTable . length > 0 ) {
725725 // append data table name to new config or data export file name
726- dataFilePath += `-${ this . _dataTable } ` ;
726+ dataFileName += `-${ this . _dataTable } ` ;
727727 }
728-
729728 // add requested data file extension
730- dataFilePath += fileType ;
729+ dataFileName += fileType ;
730+
731+ // create full data file path for saving data
732+ let dataFilePath : string = path . dirname ( this . _uri . fsPath ) ;
733+ const workspaceFolders : Array < WorkspaceFolder > = workspace . workspaceFolders ;
734+ if ( this . _isRemoteData && workspaceFolders && workspaceFolders . length > 0 ) {
735+ // use 'rootPath' workspace folder for saving remote data file
736+ dataFilePath = workspace . workspaceFolders [ 0 ] . uri . fsPath ;
737+ }
738+ dataFilePath = path . join ( dataFilePath , dataFileName ) ;
731739 this . _logger . debug ( 'saveData(): saving data file:' , dataFilePath ) ;
732740
733741 // display save file dialog
You can’t perform that action at this time.
0 commit comments