Format Parameter to upload ERROR

I need to know how to pass parameter to php, I want to upload image to localhost with xampp.

below is my php and my kodular:


<?php $imgDir = "images/"; $fileName = $_REQUEST['fname']; $data = file_get_contents('php://input'); $store = file_put_contents($imgDir.$fileName, $data); if ($store !== false ) { echo "File $fileName saved to server, $store bytes\n"; } else { echo "File $fileName not saved\n"; } ?>


error said :
Notice: Undefined index: fname in d:\xampp\htdocs\niagatimur\gbrsave.php


Warning: file_put_contents(brg/): failed to open stream: No such file or directory in d:\xampp\htdocs\niagatimur\gbrsave.php

Please help me, what sintax should i use?


This topic only now become hot topic after 1.5.5 updation

Pls read this

Thankyou 4 your answer, however that not what im lokking for.

I want to take picture by phone then save it to pc/laptop,
my problem is i dont know how to pass my image from kodular to php,
I tried above picture come up error

I find many tutorial save image on hosting, not on pc, when i try this tutorial to save image on pc/laptop not success

maybe any one can help me?

ps: i use android 9 btw

It needs storage permission to take photo…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.