Can you store an image in a PHP SESSION ?
I have a multi-step registration process using PHP on my site. On one of the steps, the users can upload their company log
Sometimes We need to preview/confirm page before save data into database.
But Image file to the confirm page is a little bit differnt.You cant do
$_SESSION['s_name'] = $_FILES['f_name']
coz SESSION just keep the text file.
In the alternative way keeping file contents/binary value in session.
$_SESSION['obj_image_session'] = file_get_contents($_FILES['image_name']['tmp_name']);
$file= "new_file.jpg";
$fp=($file,"w");
fwrite($fp,$_SESSION['obj_image_session']);