You are here: Help needed / failed to open stream: Permission denied « PHP « IT news, forums, messages
Help needed / failed to open stream: Permission denied

Posted by Ndagi Mutiri on 10/19/05 12:04

Hello,

Trying to read a binary file in MySQL database, i have the following error :

Warning: fopen(./) [function.fopen]: failed to open stream: Permission denied in d:\...\download.php on line 57

This is line 57 $file_handle = fopen("./" . $file_name, "r");

and my function

function db_download_file($dbname, $file, $idreunion) {
//Sélectionne la base de données
mysql_select_db($dbname);

//Requête SQL
$select = "SELECT " . $file . " FROM inter_vertaaldienst WHERE id_reunion = '" . $idreunion . "'";

//Exécution de la requête
$file_records = @mysql_query($select);

//En cas d'erreur, on affiche un message
if (!$file_records){echo('<p>Erreur :' . mysql_error().'<p>');}
//Autrement, on affiche le fichier
else{
if($file_record = mysql_fetch_array($file_records)){
$file_handle = fopen("./" . $file_name, "r");
$file_bytes = $file_record[0];
fwrite($file_handle, $file_bytes, strlen($file_bytes));
$return_value = "./" . $file_name;
}
}
return($return_value);
}

Thank for your help.
Ndagi

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация