Ahh 1 var så 1 sek og ikke 1000 som man normalt ser/bruger ;-)
Fandt dette på en side men kan stadig ikke få det til at virke.
You can use php's sleep($seconds) function to slow down a page load. However, you would need to turn implicit output buffer flushing to "on" with ob_implicit_flush(true); if you want anything to be sent to the user's browser before the page is done being processed. Otherwise your page won't have ANY contents until it's done loading. Calling sleep alone won't do the trick.
http://php.net/manual/en/function.flush.phpKoden ser sådan ud nu:
I imageloader.php
<?php
$path = $_GET['file'];
$filename = explode( '/', $path );
$filename = $filename[count( $filename) - 1];
header('Content-Description: File Transfer');
header('Content-Type: Content-Type: image/jpeg');
header('Content-Length: '.filesize($path));
header('Content-Disposition: filename="'.$filename.'"');
//readfile($path.'/'.$file_name); // This doesnt work as it loads the whole file!!!!
$fp = fopen( $path, 'rb');
while(!feof($fp)) {
print(fread($fp, 1024));
ob_implicit_flush(true);
sleep(1);
}
fclose($fp);
?>
Og i html koden ser linjen sådan ud:
<img src="images/picloader.php?file=0100-Antilope-BR-e1415905123571.jpg" />