Forum Moderators: coopster

Message Too Old, No Replies

fread

fread shifting from script to module in apache

         

Juanse

5:12 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Dear all,

I am reading excel files for our internal apps server.

Having changed from coexisting module in apache and script interpreter I have noticed fread stops before I expected.
The code works if I add the apptype directive to apache http.conf, kind of

...
AddHandler php-script .php .php4
Action php3-script /php/php.exe
...

I think fread finds an 1a in the excel fiel, so it justs stops having read 8 bytes instead of 30.000

Is there any workaround to this problem?

(The function file_get_contents() is unavailable for my server at this moment. )

thanx

Juanse

5:52 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



Dear me,

I found out for me and I help myself...

As php use cases say for fread in [es2.php.net...] ,

If you use:

fopen($file, "rb")

You can securely read files under win32

With fopen($file, "r") you face the risk of finding an
1A and finishing prematurely the read process

-This is meant for weird ascii files not the average text file-

jatar_k

6:08 pm on Jul 9, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld Juanse,

php.net is really an amazing site. I often find exact answers to my questions in the user comments.

Glad you sorted it out. ;)