Re: Help with Filesize

From: Date: Tue, 28 Jan 2003 15:19:22 +0000
Subject: Re: Help with Filesize
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133374@lists.php.net to get a copy of this message
Try fstat() function on the file pointer - it will return you the various results, including its size. -- Maxim Maletsky maxim@php.net Rodrigo Corrêa <rodrigo@praticsistemas.com.br> wrote... : > > How do i use the function filesize, because i´m using like: > > I just want associate the variable $body with a html file > > $file_name = 'c:/templates/resp_rep_efetiva_contrato.php'; > $fd = fopen($file_name,"r"); > line 27 $size = filesize($file_name); / Dá erro aqui > $body = fread($fd, $size); > $mail = mail($address, $subject, $body, $header); > it keeps saind that: > > Warning: stat failed for c://templates/resp_rep_efetiva_contrato.php (errno=2 - No such file or > directory) in line 27 > > but, the file exists because the fopen function works ok, I don´t known what to do > > > > Thanks in advance > > > -------------------------------------------------------------------------------- > Equipe Pratic Sistemas > Rodrigo Corrêa > Fone: (14) 441-1700 > suporte@praticsistemas.com.br > rodrigo@praticsistemas.com.br > > >

« previous php.general (#133374) next »