Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pauljohansson
Creator III
Creator III

Change Name of downloaded File

Hi,

I want to extract the data from an existing Visual from an existing Qlik App & store the result on Disk with a specific name. 

  1. connect to server
  2. connect to app (App API)
  3. fetch data from visual (Visualization API)
  4. export with a specific name

I manage to do 1-3, but dont manage to change the filename of the downloaded file.  Any advice?

//open app
var app = qlik.openApp('a5a8c513-d2e5-4ec9-be1e-1ebd995a493a', config);

// Get visuals data & export
app.visualization.get('EaqBxc').then(function(vis){
vis.exportData({format:'CSV_T', state: 'A'}).then(function (link) {window.open(link);
window.close();
});
});

} );

 

Thanks in advance

Labels (1)
  • API

4 Replies
pauljohansson
Creator III
Creator III
Author

I will answer this one myself 🙂  you can rename the file in Client Javascript, however, its not possible to change the path. The file will always end up in your profiles Download folder set in your browser, which makes perfect sense.

 

If you want to specify filepath/name I assume Node.js is the way to go.

 

 

alex_colombo
Employee
Employee

Hi @pauljohansson , your goal is to change the file name that it comes automatically from Qlik server, such as a50e4226-79e3-45cb-aed4-744dbd52c4b0.xlsx for an excel file?

If so, you can rename the exported file before giving it to the client. You can do it with few Javascript lines

pauljohansson
Creator III
Creator III
Author

Hej @alex_colombo ,

no , the goal is actually to change the download path, which is not possibly using client javascript - the file will always end up in the download folder.  I guess the solution would be to go for Node.js,

br

Paul

alex_colombo
Employee
Employee

Why do you want to change the download folder? This is a client setting which comes from browser settings. Or you mean the download url such as https://_qlikServer_/tempcontent/c4375340-0f60-4f8d-b42c-edb10f98db73/898f86e9-5700-4dee-a547-56ca04529cc2.xlsx?serverNodeId=f547ea7c-864a-44a3-87a2-00817848d756?