online submission help!

liunx

Guest
I've been asked to run a photo comp on my web site. <br />www.photofinale.org<br />I would like to be able to set a file size limit and I would like to only accept jpegs. I was hoping to be able to do this with e mail, however my host has told me this is not possible.<br /><br />is there another way I could get submissions and impose a file format and size limit? I suspect it could be done using a dynamic site but I hav eno idear on how to do this.<br /><br />thank you for any help<!--content-->
This is a scripting problem which has been solved many times before.<br /><br />Try Hotscripts -> PHP -> Script & Programs -> Image Handling/Upload<br /><br />These generally allow you to:<br />- provide an unsecured upload form (user clicks browse + it uploads)<br />- limit by filesize (default is 4 MB)<br />- limit by filetype (eg image only)<br />- optionally generate a thumbnail<!--content-->
thanks for the advise I'm going to go there now!.<br /><br />some one else said similar..<br /><br /> extract file extension from name <br />- Check file extension/file size - is it valid? <br />- Check dimension/resize if necessary. <br />- Paste the images data into new, dynamicallly created gif/jpg file - this is not only required to do the resize, but if you do it anyway, it will reject a file that's name jpg but isn't really a jpg or is broken. <br />- Save new image to file <br />- Delete the original uploaded image<br /><br />this is a stupid question but if I've never used php is this something I'm going to be bale to learn in the next month or so?...<br />(I'm assuming its relly hard and the answer is no way)<br /><br />thanks again for your advice.<!--content-->
Chop: it's not really hard as things go, but usually a PHP beginner's first month or two are spent simply learning how to use the logic and syntax in the right way. For example you will need to use at least these functions for making that script:<br />- stristr<br />- substr<br />- getimagesize<br />- imagecreatefromjpeg<br />- imagecopyresampled<br />- imagejpeg<br />- unlink<br /><br />each of these must be used in a specific way, and all have specific syntax, and so whilst it would be possible to make one from n00b to working in about a month, it would be quite hard.<!--content-->
 
Back
Top