Question: I uploaded some files to a folder, and when I use filesize function I get this message:

```
Message: filesize() [function.filesize]: stat failed for http://www.books.tahasoft.com/216.ppt

```

the path of file is: 

```
http://www.books.tahasoft.com/216.ppt

```

and here is my code:

```
<?
echo filesize("http://www.books.tahasoft.com/216.ppt");
?>

```

How can I fix this?

Answer: 
You can use like this....... 

```
 $ch = curl_init('http://www.books.tahasoft.com/216.ppt');
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
 curl_setopt($ch, CURLOPT_HEADER, TRUE);
 curl_setopt($ch, CURLOPT_NOBODY, TRUE);
 $data = curl_exec($ch);
 $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);

 curl_close($ch);
 echo $size;

```
for getting the size of your file from filesize() function, you need to add folder path of the file to get the size.

==> False Method: $filePath = "<http://www.books.tahasoft.com/216.ppt>";

==> True Method: folder path like: $filePath = '/home/www/uploadpath/filename';

So, you get the result by calling the function like:

filesize($filePath);

OR

If you want to get the size from the link, you have to do like this:

strlen(file\_get\_contents("<http://www.books.tahasoft.com/216.ppt>"));