Plasma wrote:Sure?
Can you give me an example filename you cant put directly in the page source?
Perhaps im not understanding the problem 🙂
Probably not 😃
..
I have images saved on the server in base64 encoding. This files need to be displayed all at once (as thumbnails, but this a side). You can'tjust do "bla bla first image and then <img src='image1.jpg'>", next "bla bla second image and then <img src='image2.jpg'>", etc. because this would output encoded images, which is no good for output.. Instead, I do this: "bla bla first image and then <img src='callimage.php?imagename=image1.jpg'>", next "bla bla second image and then <img src='callimage.php?imagename=image2.jpg'>..
(actually, i don't send the vars this way, I use a temporary session to transfer the vars.. ).
This is how callimage.php looks like:
<?php
//READ SESSION & READ VARS:
//-------------------------
//This call either creates a new session or re-establishes an existing one.
session_start();
$jpgSource = $_SESSION["targetJPG"];
//REMOVE SECURITY LINE IN FILE AND DECODE FILE CONTENTS:
//------------------------------------------------------
$data = file($jpgSource);
array_shift($data);
$data = implode('', $data);
$file = base64_decode($data);
header('Content-Disposition: inline; filename="ABetterName.jpg"');
echo $file;
?>
Kind regards,
Roel