Change this:
define("UPLOAD_DIR", "/home/me/Scrivania/prova");
To this:
define("UPLOAD_DIR", "/home/me/Scrivania/prova/");
Tested your script on my server and works fine, just needed that extra slash on the end, because the url to where the file is to be uploaded to is translates to:
/home/me/Scrivania/provafile.txt
when it should be
/home/me/Scrivania/prova/file.txt
-- Edit --
Also if you intend on using the ext array change the if statement to the following:
if ( in_array($temp[1], $allowedExts) ) {