Ok, so just in case I wasnt clear about the whole thing, I want to point something out.
I can actually see the file I send from the applet in the private files block if I refresh it manually (either pressing the "manage my private files" button of the block or refreshing the whole Moodle webpage.
My question is how could I just refresh the private files block using some php code. Probably the variables $Output or $Page could have something to do about it but Im just a little bit lost here.
Thanks again!