0
Guys I’m developing an Ionic app where I want to send a file (actually a photo ), this type of request I tried on get, but it didn’t work... How can I fix ? (The problem is sending 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
So Ionic as their website says only accepts
HTML, CSS and JS
, so you won’t be able to run PHP inside your APP, either one or vc uploads into the device itself using some component, or vc Fz upload to an external server ai tera que mistura uma boa dose de JS a uma programação extra ... take this example.– SK15
SK15 I know Ionic does not work with php, that file is what is on the server .... I wonder if I send the request via post form field it would accept ? and if so how do I do the request post by passing Camo file ? If not how to send ?
– Augusto Furlan