Re: [PHP] Reading binary file data into variable

2005-06-17 Thread JamesBenson
I have one for windows, think it works with PHP4 aswell, not sure where i put it so let me know if you require it and Ill dig it up? problem is it wont work on Linux. Jay Blanchard wrote: [snip] Did you try using fopen's binary safe read? Something like : [/snip] Shy of being able to do

RE: [PHP] Reading binary file data into variable

2005-06-15 Thread Jay Blanchard
[snip] Did you try using fopen's binary safe read? Something like : [/snip] Shy of being able to do this in the way that I imagined, does anyone know of a class (not requiring PHP 5, as one does on phpclasses.org) that will allow me to specify several PDF and/or other files in a directory to be

RE: [PHP] Reading binary file data into variable

2005-06-15 Thread Jay Blanchard
[snip] Did you try using fopen's binary safe read? Something like : $binary_data = ""; $fp = fopen ( $file, "rb" ); while ( ! feof ( $fp ) ) { $binary_data .= fgets ( $fp ); } fclose ( $fp ); Don't know if it will work (or if you already tried it)...more like a guess. [/snip] Yes, tried

Re: [PHP] Reading binary file data into variable

2005-06-15 Thread John Nichel
Jay Blanchard wrote: I am following Coggeshall's article on Zend for creating ZIP files. I seem to have run into a problem with PDF's though. In his code you have to read the file into a variable. I have tried file_get_contents, readfile, a combination of fopen, fpassthru, etc $filedata = r