Jump to content

Image upload to support multiple file types.


TimUSA

Recommended Posts

How do I change this so that it supports jpg, jpeg, bmp

 

echo'
<form name="form1" method="post" action="'.$scripturl.'?page=181'.$GET['page'].'" enctype="multipart/form-data">
<input type="file" name="imagefile">
<br>
<input type="submit" name="Upload" value="Upload">
</form>';
if(isset($_POST['Upload'] )) {
if ($_FILES['imagefile']['type'] == "image/png") {
	copy ($_FILES['imagefile']['tmp_name'], "screenshots/".$_FILES['imagefile']['name'])
			or die ("Could not copy");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.