Re: [PHP] Getting the filesize of an image?
On Sat, Dec 01, 2001 at 09:55:47AM +0200, faeton wrote: Hello Matt, filesize() works only on local filesystems. If you want the size of a remote file, you'll have to download it; HTTP doesn't provide a way to query a remote file's size. FTP does, if you have FTP access. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] Getting the filesize of an image?
Hello Matt, Of course it does not, but as i've already said file() with strlen() can be used. :) MM If you want the size of a remote file, you'll have to download it; HTTP MM doesn't provide a way to query a remote file's size. FTP does, if you have MM FTP access. Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting the filesize of an image?
On Sat, Dec 01, 2001 at 11:05:51PM +0200, faeton wrote: Hello Matt, Of course it does not, but as i've already said file() with strlen() can be used. :) MM If you want the size of a remote file, you'll have to download it; HTTP MM doesn't provide a way to query a remote file's size. FTP does, if you have MM FTP access. Not on binary files. For an image that's 4494 bytes, file/join/strlen gives me 3512. And since file() on a remote file is downloading it anyway, you might as well do it right: $fp = fopen('http://example.com/image.jpg','r'); while (!feof($fp)) $image .= fread($fp,1024); echo strlen($image); Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] Getting the filesize of an image?
Hello Matt, So does that problem have a solution? MM Not on binary files. For an image that's 4494 bytes, file/join/strlen gives MM me 3512. And since file() on a remote file is downloading it anyway, you MM might as well do it right: MM $fp = fopen('http://example.com/image.jpg','r'); MM while (!feof($fp)) MM $image .= fread($fp,1024); MM echo strlen($image); MM Matt Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Getting the filesize of an image?
Is there any easy way to get the filesize of an image on a remote server? Please tell me there is! TIA -- Uchendu Nwachukwu newsreply AT unndunn DOT com - www.unndunn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting the filesize of an image?
Yes -- RTFM. http://php.net/getimagesize --kurt On Friday 30 November 2001 04:04 pm, Uchendu Nwachukwu wrote: Is there any easy way to get the filesize of an image on a remote server? Please tell me there is! TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting the filesize of an image?
Not the dimensions. Of course I knew that. I want the file size, as in 'how many bytes'. GetImageSize() doesn't do that. -- Uchendu Nwachukwu newsreply AT unndunn DOT com - www.unndunn.com Kurt Lieber [EMAIL PROTECTED] wrote in message E169xrH-0001ED-00@z8">news:E169xrH-0001ED-00@z8... Yes -- RTFM. http://php.net/getimagesize --kurt On Friday 30 November 2001 04:04 pm, Uchendu Nwachukwu wrote: Is there any easy way to get the filesize of an image on a remote server? Please tell me there is! TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] Getting the filesize of an image?
Hello Uchendu, Maybe comething like that would do that: ? $fo = implode(\n, file(http://www.foo.net/image.jpg;)); $size = strlen($fo); ? Eh? :) UN Not the dimensions. Of course I knew that. UN I want the file size, as in 'how many bytes'. GetImageSize() doesn't do UN that. Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com ::: #95# Format C: complete. Format another? (Y/Y) ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting the filesize of an image?
On Fri, Nov 30, 2001 at 07:04:08PM -0500, Uchendu Nwachukwu wrote: Is there any easy way to get the filesize of an image on a remote server? Please tell me there is! TIA It scares me that nobody has answered with filesize() yet. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re[2]: [PHP] Getting the filesize of an image?
Hello Matt, filesize() works only on local filesystems. MM It scares me that nobody has answered with filesize() yet. MM Matt Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemichat.com ::: Documentation - The worst part of programming. ::: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]