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
Navigation:
[Reply to this message]
|