Flws...

Posted 09/05/2006, 21:09
Posted 10/05/2006, 08:08
Posted 10/05/2006, 08:31
Posted 10/05/2006, 18:33
$imagem_prin = $_FILES['imagem_prin']['name']; $path=$_SERVER["DOCUMENT_ROOT"]; $destino="$path/imagens/fotos/$nome/$imagem_prin"; $foi = move_uploaded_file($_FILES['imagem_prin']['tmp_name'],$destino);
Edição feita por: M4rc0, 11/05/2006, 08:14.
Posted 14/01/2008, 09:39
<form id="form" method="POST" action="curriculum_upload.php" enctype="multipart/form-data" > <label>Nome</label> <input type="text" name="nome" size="50" /> <br /> <label>Cidade</label> <input type="text" name="cidade" size="50" /> <br /> <label>Estado</label> <input type="text" name="estado" size="3" /> <br /> <label>E-mail</label> <input type="text" name="email" size="34" /> <br /> <label>Curriculum</label> <input type="file" name="curriculum" /> <br /> <label>Mensagem</label> <p> <textarea name="mensagem" cols="50" rows="6"></textarea> <br /> <input id="enviar" type="submit" name="Enviar" value="Enviar" /> <input id="limpar" type="reset" name="Limpar" value="Limpar" /> <br /> </p> <p>*Envie arquivo tipo .doc, .txt ou .pdf!</p> </form>
$path=$_SERVER["DOCUMENT_ROOT"]; $arquivo = $_FILES['curriculum']; $titulo = $arquivo['name']; $tamanho = $arquivo['size']; $tipo = $arquivo['type']; $temporario = $path.$arquivo['tmp_name']; echo" Titulo: $titulo<br> Tamanho: $tamanho bytes<br> Tipo: $tipo<br> Temporario: $temporario<br>"; if($tamanho > 0 && strlen($titulo) > 1) { $destino = $path.'/marly/arquivos/'; $caminho = $destino.$titulo; echo"Destino: $destino<br> Caminho: $caminho<br>"; if(preg_match('/^(.*)\.(doc|txt|pdf)$/', $tipo)) { if(move_uploaded_file($temporario, $caminho)) { print "<p>Arquivo enviado com sucesso!</p>"; }else{ print "<p><span style='color: #FF0000'>Erro no envio.</span></p>"; } }else{ print "<p><span style='color: #FF0000'>Esse tipo de arquivo não pode ser enviado.</span><br> Envie um arquivo .doc, .txt ou .pdf!</p>"; } }
Posted 14/01/2008, 09:46
if(preg_match('/^(.*)\.(doc|txt|pdf)$/', $tipo)) {
Posted 14/01/2008, 09:50
Que tipo de arquivo você está tentando enviar?
Pois, nesta parte:if(preg_match('/^(.*)\.(doc|txt|pdf)$/', $tipo)) {
Ele está verificando o tipo do arquivo, e só deixa passar arquivos .doc, .txt e .pdf
Posted 14/01/2008, 10:01
if(preg_match('/^(.*)\.(doc|txt|pdf)$/', $tipo)) {
Posted 14/01/2008, 10:08
Posted 14/01/2008, 10:27
Edição feita por: Marcivone, 14/01/2008, 14:04.
Posted 14/01/2008, 10:28
$temporario = $path.$arquivo['tmp_name'];
$temporario = $arquivo['tmp_name'];
Posted 14/01/2008, 14:55
$destino = '/marly/arquivos/';Depois:
$destino = 'marly/arquivos/';Valewww!!!!
Posted 23/06/2010, 16:55
Posted 23/06/2010, 18:45
$uploads_dir = '/images';
$uploads_dir = 'images';
$uploads_dir = '../images';
Posted 11/10/2017, 15:56
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)