I have a form from which an attached file is sent via email. The problem is that when I upload the file, it does not seem to pass the value of $_FILES
via formulário/jquery
. See below:
HTML
<form role="form" class="contact-form" id="contact-form" method="post">
<div id="success"></div>
<div class="form-group">
<label for="career-name">Nome</label>
<input type="text" name="Nome" class="form-control" id="nome">
</div>
<div class="form-group">
<label for="career-name">E-mail</label>
<input type="text" name="Email" class="form-control" id="email">
</div>
<div class="form-group">
<label for="career-name">Vaga pretendida</label>
<input type="text" name="Vaga" class="form-control" id="vaga">
</div>
<div class="form-group">
<label for="career-resume">Currículo</label>
<input type="file" name="Arquivo" class="form-control" id="curriculo">
</div>
<button type="submit" class="btn btn-primary" id="submit"><i class="icon-ok"></i> Enviar</button>
</form>
JQUERY
<script type="text/javascript">
$('#submit').click(function() {
$.post("includes/enviar-curriculo.php", $(".contact-form").serialize(), function(response) {
$('#success').html(response);
$('#nome').val('');
$('#email').val('');
$('#vaga').val('');
$('#mensagem').val('');
$('#curriculo').val('');
});
return false;
});
</script>
PHP FILE
<?php
....
$curriculo = $_FILES["Arquivo"];
echo $curriculo['name'];
....
?>
Is it possible to pass $_FILES
values via Jquery?