0
$arquivocom = $_FILES['submetidocom']['name'];
$diretoriocom = "C:/Users/NEWGRID/Documents/uploadcom/";
move_uploaded_file($_FILES['submetidocom']['tmp_name'], $diretoriocom.$arquivocom);
if (file_exists($arquivocom)){
echo"<script language='javascript' type='text/javascript'>alert('Arquivo 2 já existente, por favor renomeio-o e tente novamente');</script>";
}else{
echo"<script language='javascript' type='text/javascript'>alert('Upload 2 feito com sucesso!');</script>";
}
HTML
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
<input type="file" class="form-control-file" name="submetidocom" value="<?php echo $submetidocom; ?>" id="submetidocom" required="" autofocus="">
</div>
Shows no error ?
– rbz
No, the file name and directory saved in the bank but the file does not go to folder
– Jefferson silva pereira
You use IIS in your environment?
– Fabiano Monteiro
How is set the "upload_tmp_dir" directive in your php.ini?
– Fabiano Monteiro
Do not use IIS, "upload_tmp_dir" looks like this: ;upload_tmp_dir =
– Jefferson silva pereira
You have permission to write in the directory ?
– Marcos Brinner
If you are trying to write in directories after the root of your site example your site ta in the folder c:/localhost/meusite and try to write in c:/usuairos/othern will give problem if you do not have write permission
– Marcos Brinner
I do have access
– Jefferson silva pereira
Check your directives post_max_size, upload_max_filesize. There is a checklist that can help you here: https://stackoverflow.com/questions/12531408/setting-php-tmp-dir-php-upload-notworking
– Fabiano Monteiro
These directives had already changed some time ago to be able to import the database.
– Jefferson silva pereira
So try using the function
copy()
instead ofmove_uploaded_file()
Thus:copy($_FILES['submetidocom']['tmp_name'], $path);
– Fabiano Monteiro