Friend..Need help.
i use php 4.0.5 and apache1.3 in windows xp.
i store picture files in database mysql.for the viewing purpose, i echo the file content as link.When i click the link.I get a save as message box.I can save the file in my local computer and view file fine but when i click the open button in “save as message box” , i unable open the file successfully.
The error message :
the path or file name c:document and settingstestlocal settingsTemporary Internet filescontent.IE5k9mzderamodule4[1].ppt is invalid.please check the path and file name correct.
In my php.ini i declare the upload_tmp_dir =”C:/apache/php/uploadtemp/” ;
page1.php
<? echo “ “. “<a href=”slide-view.php?id1=$id1″> $name[/url]”; ?> –> if i click the link, the download message box appear and when i click open i get error as above.
slide-view.php
<?php
session_start();
mysql_connect(“localhost”, “root”, “root”) or die(“no connection”);
mysql_select_db(“gddatab”) or die(“no database”);
if(isset($HTTP_GET_VARS[‘id1’]))
{
$id = $HTTP_GET_VARS[‘id1’];
$query = “SELECT cs_name, cs_type, cs_size, cs_content FROM ots_slide WHERE cs_id = ‘$id'”;
$result = mysql_query($query) or die(‘Error, query failed’);
list($name, $type, $size, $content) = mysql_fetch_array($result);
header(“Content-length: $size”);
header(“Content-type: $type”);
header(“Content-Disposition: attachment; filename=$name”);
echo $content;
exit;
}
?>