Ionic upload file

0

I am developing an ionic app where I want to send a file (actually a photo), this type of request I tried to get, but it did not work ... How can I fix it? (the problem is send via get? My php file is this:

  <?php
		$foto = $_FILES['img']['name']; // nome do arquivo
		$uploaddir = '';
		$dirArquivo = $uploaddir . $foto;
		if(file_exists($dirArquivo) == true) {header ('location: ../admCreateVagas.php?msg=ERRO:ARQUIVO_NAO_ENVIADO_ja_existe_mude_o_nome_e_tente_novamente');} else {
			$uploadfile = $uploaddir . $_FILES['img']['name'];
			if (move_uploaded_file($_FILES['img']['tmp_name'], $uploadfile)){
			}else{ print_r($_FILES); echo "Arquivo não enviado"; header ('location: ../admCreateVagas.php?msg=ERRO:ARQUIVO_NAO_ENVIADO');}
			
			}

	

?>

Thank you

    
asked by anonymous 26.04.2016 / 15:05

0 answers