Caros amigos
Tenho este problema na hora de enviar os arquivos. Quando a imagem é maior do que 20 kb ele retorna com a seguinte mensagem:
Arquivo maior que o tamanho máximo permitido
fotos menores do que 20 kb ele manda sem problema:
Segue o script:
<?php
if (@$_POST['submit_files']){
$Dir = "imagens";
$MaxTam = 1024 * 20;
$aExtensoes = array("gif","jpg","bmp","jpeg","png","psd");
$_FILES['arquivo']['name'] = array_unique($_FILES['arquivo']['name']);
$Arq = $_FILES['arquivo'];
foreach ($Arq['name'] as $chave => $arqNome){
if ($Arq['error'][$chave] == 0){
if (in_array(strtolower(substr($arqNome, strrpos($arqNome, ".") + 1)), $aExtensoes)){
$nome = str_replace(" ", "_", $arqNome);
$tamanho = $Arq['size'][$chave];
$tmp = $Arq['tmp_name'][$chave];
$type = $Arq['type'][$chave];
if (!file_exists($Dir.$nome)){
if ($tamanho <= $MaxTam){
if (move_uploaded_file($tmp, $Dir.$nome)){
print "- Arquivo ({$nome}) enviado com sucesso!<br />";
}
else
{
print "- Erro ao enviar o arquivo ({$nome})<br />";
}}
else
{
print "- Arquivo maior que o tamanho máximo permitido ({$nome}) {$tamanho}<br />";
}}
else
{
print "- Arquivo existente ({$nome})<br />";
}}
else
{
print "- Extensão inválida do arquivo ({$arqNome})!<br />";
}}}}?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form enctype="multipart/form-data" method="post" action="<? $_SERVER['PHP_SELF']?>">
<input type="file" name="arquivo[]" /><br />
<input type="file" name="arquivo[]" /><br />
<input type="file" name="arquivo[]" /><br />
<input type="file" name="arquivo[]" /><br />
<input type="file" name="arquivo[]" /><br />
<input type="submit" name="submit_files" value="Enviar" /></form>
</body>
</html>
Me ajudem se possível
Grato

Upload De Várias Imagens
Started By renatomga, 13/10/2005, 21:59
1 reply to this topic
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)