in reply to file upload

Have you checked your http server logs for error messages ?

Does it work if you write your file to a "static" filename ? for example:
open OUTFILE, "> /tmp/test_upload" or die "error: $!";
Using directly $filename, from the CGI param(), in open() is insecure as someone could overwrite your system files by uploading files named "../../../var/www/html/index.html" for example. It is wiser to use a temporary filename and never trust the filename from param().