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.
Document contains no data
Moderator: General Moderators
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:
Victor.
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>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:
Victor.
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;
}
}