Tmp Reading


Orange Electronic P409S Retrofit Tire Pressure Monitoring System


Orange Electronic P409S Retrofit Tire Pressure Monitoring System


$108.38


Universal Fit Product Features *Includes a lithium ion battery *Projected 5 to 7 year battery life *Displays tire pressure *Ergonomic Design Orange Electronics Tire Pressure sensors feature a military specification lithium ion battery with a projected 5 to 7 year battery life. All sensors come complete with a unique valve stem assembly which incorporates a ball joint fitting allowing the ...

No items matching your keywords were found.



Get files from remote file size with PHP

SOURCE: File size remote file "> Collection File size of remote files with PHP

To get the file size of local files in PHP, you can use the file size () (Http: / / php.net / manual / en / function.filesize.php), the function will produce the requested file size in bytes size. Unfortunately, these functions can not be used on the remote files, or files that are beyond our servers. There are several ways you can use to read the file size remote files using basic functions available in PHP.

The first method
The first way is to use curl (http://curl.haxx.se/). With this feature, read the entire remote file or in other words, it is downloaded in advance and stored in the tmp folder. In general, these functions have been found in PHP engines> 5.

[Php]
$ Url = 'http://www.google.com/intl/en_ALL/images/srpr/logo1w.png;

$ Ch = curl_init ();
curl_setopt ($ ch, CURLOPT_URL, $ url);
curl_setopt ($ ch, CURLOPT_HEADER, true);
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true);
$ Site = curl_exec ($ ch);
curl_close ($ ch);

if (preg_match ('/ Content-Length: ( d $ +)/', site, $ matches)) (
$ ContentLength = (int) $ matches [1];
)

echo $ ContentLength / / Google Logo size in bytes
[/ Php]

Get file size of remote files with PHP

The second method (better and faster!)
The second way is to use the get_headers (), which was introduced since version 5 of PHP, so if you are still using version PHP 4, then you can not perform this function. With this feature, the server does not have to download the entire file, so it is very fast and saves resources servers.

[Php]
SOURCE: title = "Get Remote File Size"> Get files from remote size PHP File
[/ Php]

We hope this brief article can help and can solve problems in reading a remote file:)

SOURCE: title = "Get Remote File Size"> Get files from remote file size with PHP

About the Author

Founder of Buzzknow

My other site

Remote Wireless Speakers Online Degree Higher Education

Leave a Reply

You must be logged in to post a comment.