Pemrograman Mobile React-Native

Tutorial React Native : Upload Gambar Menggunakan Fetch

By on May 25, 2018

Library

https://youtu.be/WhiUa5yt6XU

https://github.com/marcshilling/react-native-image-picker

Source Code

API

<?php

$target_dir = “uploads/”;
$target_file = $target_dir . basename($_FILES[“fileToUpload”][“name”]);

$status = array();

if (move_uploaded_file($_FILES[“fileToUpload”][“tmp_name”], $target_file)) {
$status[‘kode’]=1;
$status[‘deskripsi’]=’upload berhasil’;
} else {
$status[‘kode’]=0;
$status[‘deskripsi’]=’upload TIDAK berhasil’;
}
echo json_encode($status);

?>

TAGS
RELATED POSTS

Page optimized by WP Minify WordPress Plugin