quickndirty Posted November 17, 2009 Share Posted November 17, 2009 I got this warning in a ghetto blog script I'm making Warning: filesize() expects parameter 1 to be string, resource given in C:\wamp\www\League\newswriter.php on line 35 ........ I don't understand lol...filesize clearly has only one main parameter and that is always the resource AFAIK. so why would this warning come up? Quote Link to comment Share on other sites More sharing options...
Alex Posted November 17, 2009 Share Posted November 17, 2009 You should post the code. Are you trying to pass a resource returned by something like fopen()? As the error states, you're supposed to pass the filename (String) of the file, ex: someimage.jpg, not a file resource. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted November 17, 2009 Share Posted November 17, 2009 I don't understand lol...filesize clearly has only one main parameter and that is always the resource AFAIK. so why would this warning come up? The manual explicitly states that the parameter is a string that is the path to the filename. http://php.net/filesize Quote Link to comment Share on other sites More sharing options...
quickndirty Posted November 17, 2009 Author Share Posted November 17, 2009 haha ok guys thanks and cheers! i'm stupid sometimes 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.