dom at dodgydom dot com wrote:
Best way i found was to open the url into $data and make a temporary file with the contents of $data then get the fstats on the temporary file :).
OMG why? The only thing that will remain is the file size. You also download up to 1G file, which probably is not what you want.
To get size use PHP's function filesize() with URL wrappers or ask yourself via HTTP.
fstat
(PHP 4, PHP 5)
fstat — Vrací informace o otevřeném souboru
Popis
array fstat ( resource $handle )Sbírá statistiky otevřeného souboru specifikovaném deskriptorem fp. Tato funkce je podobná funkci stat(), pracuje však s deskriptorem, nikoli názvem souboru.
Vrací pole se statistikami souboru s těmito elementy:
- device
- inode
- number of links
- user id of owner
- group id owner
- device type if inode device *
- size in bytes
- time of last access
- time of last modification
- time of last change
- blocksize for filesystem I/O *
- number of blocks allocated
Výsledek této funkce je cachován. Více detailů - viz clearstatcache().
fstat
mordae at mordae dot net
29-Jan-2006 07:12
29-Jan-2006 07:12
sheran at comtrust dot co dot ae
21-Feb-2001 05:14
21-Feb-2001 05:14
On Windows NT the typical array element names for the fstat function are:
dev
ino
mode
nlink
uid
gid
size
atime
mtime
ctime
jason at inetgurs dot net
14-Nov-2000 07:01
14-Nov-2000 07:01
Currently fstat() is indexed by name instead of by number like stat().
Example: $s_array=fstat($fp); print $s_array["mtime"];fclose($fp);
