Hi There,
I was planning on letting users upload files to a database, but was having problems with image files in MSSQL.
Instead, i'm letting them upload files via a html/php script which works fine.
the files upload to a directory on the f:\drive which isn't shared out at all, and i want to keep it this way for security purposed. Instead i was php to present the file to the user using the header command.
so far i have tried this with little success....
of course the actual $file values will be pulled out of a database
<?
$filepath = "f:\data\accountd\file.jpg" ;
$filename = "file.jpg" ;
$filetype = "images/pjpeg" ;
$filesize = "172809" ;
fread(fopen($filepath, "r"), filesize($filesize));
header("Content-type: $filetype");
header("Content-length: $filesize");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Description: PHP Generated Data");
?>
However this gives me a "Warning: stat failed for 172809 (errno=2 - No such file or directory) in f:\inetpub\wwwroot\upload\sixopen.php on line 10
"
Is this the right way of going about this?
Thank
Mark