Author Topic: DOWNLOAD BUTTON & ADMIN TOP 5 PICTURE HITS ERRORS  (Read 13104 times)

0 Members and 1 Guest are viewing this topic.

Offline Alain

  • Newbie
  • *
  • Posts: 24
    • View Profile
EXCELLENT!
« Reply #15 on: June 17, 2002, 02:36:22 PM »
It works now!  8)

Before applying, I tried to look at http://www.php.net/manual/en/function.fopen.php


Newbie advice: The little "b" for binary operations is very
essential when working with PHP4 and Apache on the win32 platform. fread()
only reads a couple of hundred bytes when reading for example an image
without "b".
// Read tempfile data into $thumb_img.
$thumb_file_size = filesize('C:\\Temp\\temp.jpg');
$fp = fopen('C:\\Temp\\temp.jpg', "rb");
$thumb_data = addslashes (fread ($fp, $thumb_file_size));
fclose ($fp);
unlink('C:\\Temp\\temp.jpg');


This case can be closed then, I hope it will help you to improve again your excellent application!  :P