By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,949 Members | 1,824 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,949 IT Pros & Developers. It's quick & easy.

$_SESSION maximum size

P: n/a
Hi,
I'm storing an uploaded jpeg in the session :
$_SESSION['image'] = base64_encode(file_get_contents("..."));
But that data is truncated. How to prevent this ?

Another way would be to copy the file into a temp folder
and delete it when the session is destroyed.
How do I get notified when session is destroyed ?

Best regards
Thorsten

Oct 13 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hans Ebert schreef:
Hi,
Hi,
I'm storing an uploaded jpeg in the session :
$_SESSION['image'] = base64_encode(file_get_contents("..."));
But that data is truncated. How to prevent this ?
It should be perfectly possible to store the image in your session. It
is weird, but possible.
You must make some mistake when displaying it.
ARe you using base64_decode() when serving the image?

>
Another way would be to copy the file into a temp folder
and delete it when the session is destroyed.
How do I get notified when session is destroyed ?
You don't with default session.
You can build your own sessionhandler and gain full control:
Read on here if you want to take that route:
http://nl3.php.net/manual/en/functio...ve-handler.php

Regards,
Erwin Moller
>
Best regards
Thorsten

--
Oct 14 '08 #2

P: n/a
On Oct 13, 7:47*pm, Hans Ebert <tok...@news.cnntp.orgwrote:
Hi,
I'm storing an uploaded jpeg in the session :
$_SESSION['image'] = base64_encode(file_get_contents("..."));
But that data is truncated. How to prevent this ?

Another way would be to copy the file into a temp folder
and delete it when the session is destroyed.
How do I get notified when session is destroyed ?

Best regards
Thorsten
This is not a good approach..
Oct 14 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.