Page 1 of 1
Document contains no data
Posted: Mon Oct 06, 2003 3:07 pm
by jvic
When uploading some files, i get this message:
"Document contains no data".
It seems like the browser doesn't even start the upload, because it's right after i click the "upload" button (really fast). I've tested with many browsers, always get the same error.
Any suggestions?
Victor.
Posted: Tue Oct 07, 2003 9:52 am
by Nay
It would help if you posted the code you're using to upload the file(s).
-Nay
Posted: Tue Oct 07, 2003 1:47 pm
by jvic
Well, the "Document contains no data" appears too fast, which makes me think it isn't even processing the PHP code responsible for doing the upload. As for the HTML code, this is it:
Code: Select all
<form name=anexar action=anexar_arquivo2.php enctype="multipart/form-data" method=post onSubmit=return(validar(this));>
<input type=hidden name=PHPSESSID value=9fac0a39b098dd979ede09fe66c2057b>
<font class=text>Pressione o botão Browse (ou Procurar) abaixo para selecionar o arquivo a ser anexado em seguida, pressione OK para prosseguir.<br>
(arquivos .ZIP podem ser enviados e descompactados posteriormente)</font><br><br>
<input type=hidden name='MAX_FILE_SIZE' value='30000000'>
<input type="file" name="arquivo" class=text><br>
<input type=submit value='Ok' class=text>
<input type=button value='Cancelar' onclick=Atualiza();self.close(); class=text>
<input type=hidden name=cod_curso value=3>
<input type=hidden name=diret value=''>
</form>
Victor.
Posted: Tue Oct 07, 2003 1:58 pm
by mudkicker
ok that's good but what about the php code to upload? can yoıu send it, too?
Posted: Tue Oct 07, 2003 2:06 pm
by jvic
Yes i can, but i see no point in doing it (for reasons i've explained). Anyway, this is the function responsible for doing the upload:
Code: Select all
function RealizaUpload($arquivo,$destino) {
if (eregi("php$", $destino))
$destino.=".txt";
$r1=move_uploaded_file($arquivo,$destino);
if (file_exists($destino)) {
$r2=chmod($destino,0644);
return $r1;
}
else {
return false;
}
}
Victor.