Is this file uploading method secure via PHP?
<p>I use the <a href="http://en.wikipedia.org/wiki/PHP" rel="nofollow">PHP</a> language for file upload and want to know that the following method that I use is secure or not?</p>

<p>I am using simple method for file uploading,
I check the file name from $_FILES['userfile']['type']
and then if it's having an allowed file extension, I upload the file with some random number.
Like if it is abc.zip it may become 8w43x9d.zip.</p>

<p>Please tell me: is it a really bad method for file upload?</p>
