No, the global session is based on their logged in username, since it is unique to the person logged in, then it will only be theirs... that is why I did that. it is not just a single name, it is their username.
Since session is what it was using and they already have a session, I use Apache::MySql::Session, I went ahead and changed all of the code to that:
#Was: (in sub hook):
# Write this data to the session file.
open (SES, ">./$sessid.session");
print SES "$bytes_read:$length:$percent";
close (SES);
#Now (in sub hook):
my $_ups = join(':',$bytes_read,$length,$percent);
$sess_ref->attr("_uploadStatus_","$_ups");
#Was: (no sub, just in code [after upload complete]):
# Delete the session file.
unlink("./$sessid.session");
# Now in same place:
# Delete the session value.
$sess_ref->clear_attr("_uploadStatus_");
# last change:
# Was
if (-f "./$sessid.session") {
# Read it.
open (READ, "./$sessid.session");
my $data = <READ>;
close (READ);
print "$data";
} else {
print "Error reading Upload progress...";
}
#now:
$data = $sess_ref->attr("_uploadStatus_");
if($data) {
print "$data";
} else {
print "1:1:1 No Session Value Found";
}
Also of note, I see in hook, these values received in it:
$filename,$buffer,$bytes_read,$file
But I don't see a reference to hook passing those values to it. How does that work?
Now 1:1:1 No Session Value Found prints... So I am thinking that hook is never even executed.
What executes it?
Thanks,
Rich
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.