UCC Posted September 3, 2007 Share Posted September 3, 2007 My guess is that this is impossible. However, I thought I would ask. Let's say I wanted to have users host a particular image on an External site like imageshack. However, I still want to enforce file size limits so they can't link to 2MB files that other users would be forced to download. Is there anyway at all that PHP can check the file size of a remote file link? I found getimagesize but it does not show the file size just the dimensions Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted September 3, 2007 Share Posted September 3, 2007 Re: File size of Remote image? Could try a quick $a = file_get_contents('image link'); fopen('temp','w'); fwrite() filesize('temp') unlink('temp') With a bit better programming Quote Link to comment Share on other sites More sharing options...
hamster01 Posted September 3, 2007 Share Posted September 3, 2007 Re: File size of Remote image? I did some googling and found this, It should work perfect, because I don't know if you noticed but images gives out headers with their size and dimensions. http://www.phpcentral.com/207-get-files ... -file.html Quote Link to comment Share on other sites More sharing options...
UCC Posted September 4, 2007 Author Share Posted September 4, 2007 Re: File size of Remote image? Me Likey! Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.