Here is a simple file upload tutorial found in PHPBuilder. All the pages and the extra content on the website is a bit annoying. But you can click the “printable version” of the page to view the whole tutorial in one whole page.
To make things more interesting and to make it truly re-useable, I’m going to make it totally generic so we can use it again and again for differing file types.
If you want the code to look @ in your favourite editor whilst you are reading this piece, you can download it here.
Starting us off, we need to lay down some parameters, for the maximum file size you want to allow the user to upload and – if it’s an image – how high and wide the image can be, else you might get a 1.5MB, 1024 x 768 Jpeg filling up the entire screen!