What is the significance of using the "Location" parameter in the "header" function for file downloads in PHP?

When downloading files in PHP, setting the "Location" parameter in the "header" function is significant because it specifies the location of the file being downloaded. This helps the browser understand that it needs to download the file instead of displaying it in the browser window. Without setting the "Location" parameter, the file may not be downloaded correctly or may be displayed in the browser instead.

$file = 'example.pdf';
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Content-Length: ' . filesize($file));
header('Location: ' . $file);
readfile($file);
exit;