in reply to Re^6: file upload and IO::Handle
in thread file upload and IO::Handle

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