note 60006 added to features.file-upload.multiple
| From: | dv3000 at osu1 dot php dot net | Date: | Thu, 22 Dec 2005 17:20:34 +0000 |
| Subject: | note 60006 added to features.file-upload.multiple | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100585@lists.php.net to get a copy of this message | ||
Ola, minha contribuicao:
upload.htm
<html>
<head><title>Upload de Fotos</title></head>
<body>
<form action="upload.php" method="post"
enctype="multipart/form-data">
Foto1: <input type="file" name="arquivo1" size="20"><br>
Foto2: <input type="file" name="arquivo2" size="20"><br>
Foto3: <input type="file" name="arquivo3" size="20"><br>
Foto4: <input type="file" name="arquivo4"
size="20"><br><br>
<input type="submit" value="Enviar">
</form>
</body>
</html>
upload.php
<?
foreach ($_FILES as $arquivo){
$a = $a + 1;
if($arquivo[name]){
if($arquivo[type] != "image/jpeg"){
echo("Foto Nº$a: Erro: Voce so pode enviar Imagens no formato Jpg<br>");
}
else{
if (copy($arquivo[tmp_name],"arquivos/".$arquivo[name])){
echo("Foto Nº$a: Enviado com sucesso!<br>");
chmod("arquivos/".$arquivo[name], 0755);
}
else{
echo ("Foto Nº$a: Erro no envio do arquivo!<br>");
}
}
}
}
?>
Bom espero que gostem :)
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.multiple.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60006
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60006&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60006&report=yes
Search -- http://master.php.net/manage/user-notes.php