Jump to content

unable to locate file into temp directory


inspire

Recommended Posts

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 settings\test\local settings\Temporary Internet files\content.IE5\k9mzdera\module4[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</a>"; ?> --> 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;

}

 

?>

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.