使用php加载XML-空白

使用php加载XML-空白,php,xml,Php,Xml,我发现以下php代码有问题: <?php $archivo = $_REQUEST["file"]; $path = "C:\FACTURAS\AUTORIZADAS"; $fullPath = $path.$archivo; $file = $fullPath; if(!file_exists($file)); $type = filetype($file); // Send file headers header("Content-type: $type"); header

我发现以下php代码有问题:

<?php

$archivo = $_REQUEST["file"];    
$path = "C:\FACTURAS\AUTORIZADAS";
$fullPath = $path.$archivo;

$file = $fullPath;
if(!file_exists($file));
$type = filetype($file);
// Send file headers
header("Content-type: $type");
header("Content-Disposition: attachment;filename=$file");
header("Content-Transfer-Encoding: binary"); 
header('Pragma: no-cache'); 
header('Expires: 0');
// Send the file contents.
readfile($file);  
   echo $fullPath;

?>
而不是:

$file = $fullPath;
关键是我需要发送应该下载的xmldocument的名称,因为存在不同的xmldocuments。我不知道该怎么办。请帮助我,欢迎任何建议


服务器中已存在xmldocuments

可能是您在文档中隐藏了空白。在编辑器中,启用显示隐藏字符,我没有它。这很有趣,因为它是同一个文档,我正在尝试下载,当路径是文档中的常量时,它会工作,而当它从html发送时,它不会工作。我不知道我是否需要安装其他东西,因为我正在windows服务器上运行它?您使用的是
?file=\prueba.xml
?那么它应该与您的硬编码文件相同。但你可能错过了“一”字。
$file = $fullPath;