Fix document downloader with spaces in the filenames (put quotes around the filename in the http headers)

This commit is contained in:
james 2009-10-09 20:27:32 +00:00
parent 8ea2823bf1
commit f6fcb2d728

View File

@ -28,7 +28,7 @@
if($r=mysql_fetch_object($q))
{
header("Content-type: ".trim(exec("file -bi ../data/documents/$r->filename")));
header("Content-disposition: inline; filename=$r->filename");
header("Content-disposition: inline; filename=\"".$r->filename."\"");
header("Content-length: ".filesize("../data/documents/$r->filename"));
readfile("../data/documents/$r->filename");
}