473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

filesize() not reading http pages

I have checked this setting in my php.ini

allow_url_fopen = On

It is ON be default.

According to the PHP documentation:

it stated that as of php5, filesize supports the reading of remote html
files:

http://php.net/manual/en/function.filesize.php

But I have tried the following:
echo filesize("http://www.yahoo.com/");

It returned me this error:

Warning: filesize() [function.filesize]: stat failed for..blah blah

Anyone have this same problem?

Yes. Im using PHP5 and php.ini's allow_url_fopen = On (Thanks to J.O. Aho)

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 1 '07 #1
2 4642
..oO(Eric Layman)
>According to the PHP documentation:

it stated that as of php5, filesize supports the reading of remote html
files:

http://php.net/manual/en/function.filesize.php
| As of PHP 5.0.0 this function can also be used with some URL wrappers.

Notice the word "some".

The HTTP wrapper doesn't support stat() functionality.

http://www.php.net/manual/en/wrappers.http.php

Micha
Feb 1 '07 #2

"Eric Layman" <erricson@layskirjoitti
viestissä:11*************@sp6iad.superfeed.net...
>I have checked this setting in my php.ini
allow_url_fopen = On
It is ON be default.
According to the PHP documentation:
it stated that as of php5, filesize supports the reading of remote html
files:
http://php.net/manual/en/function.filesize.php
But I have tried the following:
echo filesize("http://www.yahoo.com/");
Are you serious? Think again.
Feb 1 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil Powell | last post by:
// PROCESS XML CONTENT INTO DYNAMICALLY-NAMED ARRAYS foreach (array('mime', 'state', 'country') as $val) { $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);...
6
by: John | last post by:
Hi all, I'd like to evaluate dynamicaly the size of a dynamic file. I use the filesize() function... this is my code : $my_size =...
4
by: Marek Möhling | last post by:
My server (Apache/1.3.28 - PHP/4.3.3) is configured to receive gzipped data via: Header append Accept-Encoding "gzip, deflate" PHP is configured to send gzipped data via: php_value...
2
by: IWP506 | last post by:
I just CANNOT figure out what is wrong with this! ------ $op1f = fopen("./test.txt","r"); $op1 = fread($op1f, filesize($op1f)); ------
2
by: Alan Howard | last post by:
Just migrating some code from CDONTS to CDO and noticed some behaviour I want to verify. When using cdoSendUsingPickup the outgoing email spools to the local filesystem first before being routed...
3
by: Imran | last post by:
Hello All Am trying to read a huge txt file and write to a file back. pls see the code int main() { char* pData;
4
by: Ken | last post by:
I would like to measure the fileSize of the image (without uploading it - php). I use: var size_pic = document.getElementById('num1').childNodes.fileSize; alert("size = " + size_pic); which...
4
by: Magix | last post by:
Hi, I would like to check if the data file is empty or not before reading it. How should I achieve that ? fseek/ftell ? ....fopen process here(..) if filesize is 0 // mean empty data printf...
3
by: mosscliffe | last post by:
I get a list of filenames from a directory with the following code, but I can not work out how to get the filesize of the filename I have just found. I guess it is fileinfo.length, but I can not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.