Reply to Fopen failure

Your name:

Reply:


Posted by faraz_mit on 01/24/08 10:54

HI Guys,
I am making a php file which gathers data from a form and sends an
email with attachment. Here is a small part of that:

$filename = $_FILES['document_file_name']['name'];
$path = $_FILES['document_file_name']['tmp_name'];
$file =$path."/".$filename;
echo ($file); /* which is /var/tmp/phpB2TeJi/DSC_0082.jpg */

$handle = fopen($file, "r");
if(!($handle = fopen($file, 'r'))) echo "File failed to open";

Now when i run the code i get the following warnings:

Warning: fopen(/var/tmp/phpB2TeJi/DSC_0082.jpg) [function.fopen]:
failed to open stream: Not a directory in sendmailattach.php on line
17

Warning: fopen(/var/tmp/phpB2TeJi/DSC_0082.jpg) [function.fopen]:
failed to open stream: Not a directory in sendmailattach.php on line
18
File failed to open

Can somebody tell me please what is wrong with the way i call fopen.
I am running on a shared server and also tried different permissions
such as r and rb.

Thanks in advance
Ross

[Back to original 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

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