Added "Upload" Text to public upload Button
Aborting script with error message if $dir is undefined.