在Chrome中将PHP保存为与PHP的对话?

This is what I currently have. In chrome it saves the file immediately to the downloads folder. In firefox it gives you the option of saving or opening, but still doesn't let you choose where to save the file.

    header('Content-type: text/plain');
    header('Content-Disposition: attachment; filename="' . $filename . '"');
    print file_get_contents($dir . $filename);

Is there any way to let the user choose where the file is saved/what the file is named?

Choosing where to save the file is the users choice. You have no control over it and it should not concern you.The user controls the setting for his/her particular browser

You have no control over the download behaviour of the browser, no. Chrome and Safari default to automatically download files without user interaction. You as a website owner cannot change that.