PHP readfile outputs wrong name
I have a download.php page where the user can download an XML file. Based on a dropdown select the file get's a different name. I'm using AJAX to send the name to download.php, therefore $_POST returns an array with the specified data from the js. Yet when I use readfile to download the file, in the save file dialog the string that comes from $_POST is ignored.. Here is my code:
JS:
let formData = {
shop: shop.val()
}
$.ajax({
type: 'POST',
url: './inc/download.php',
data:...