Can't say this is the best way of uploading files, this will allow anyone to upload any PHP script. PHP is a server-sided language, so people can actually gain full control (after some exploitation & fiddling around) over your server.
I have to go now but I'll post an example which filters out...
You could use the ZipInputStream the Java api provides. Simply make a HttpURLConnection to a webserver and download the file then open a FileInputStream and read it into a ZipInputStream.