in reply to Binary File Upload

is there any thing wrong with my code that I've missed?

Yes, you're missing essential parts of any good perl script:

use strict; use warnings;

And if you want to know why there is an "error 500", look in your webserver's error.log. (And don't forget to set the executable bit on the script).