0

ihave a script for a multifile uoload

my question is how can i create it so that i can upload only jpg files

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<title>multiple file upload</title>
	</head>
	<body>
	<form action="" method="post" enctype="multipart/form-data">

<input name="files[]" type="file" multiple="multiple" accept="image/gif, image/jpeg" min="1" max="9999">
<input name="upload" type="submit" class="box" id="upload" value=" Upload ">

</form>
	<?php
		
if (isset($_FILES['files'] ))	
{
foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name){
	move_uploaded_file($tmp_name, "uploaded/{$_FILES['files']['name'][$key]}");
}
}

?>

Thanks

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by johnnyd1963
0

Only Opera and Chrome seem to support this. You'll have to validate this on the server side too.

0

sorry couldn't responce earlier, No internetconection there was a internetserver problem.

Wel i had the file uploaded to my webserver and yes it did not worked in ie.
I even tested in firefox, chrome,safari and opera and there it seems to work.
I try to find another way because it worked only in firefox proper.
thanks for your advice

i try later the link that Ardav wrote

Many greetings John

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.