Jump to content

Readfile Function Takes Too Long


jan99844

Recommended Posts

Hi,

 

My first script generates .jpg images and saves them in some catalog on my server. The second script should read .jpg file and send it as an output to browser. Here is it:

<?php
header('Content-type: image/jpg');
$i   = $_GET['i'];
$uid = $_GET['uid'];
if (file_exists("graph/$uid/p$i.jpg")){
readfile("graph/$uid/p$i.jpg");
}
else { readfile("empty.jpg") ; }
?>

Everything works just fine besides the time which takes to output images. Let's say when the first script save image in the catalogue, the second script has to be run few times (around 15 seconds) to display correct image. Do anyone know where is the problem ?

Link to comment
https://forums.phpfreaks.com/topic/270877-readfile-function-takes-too-long/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.