First, this is the first time i code both of web service and android (normally just android), so please bear with me.
I tried to upload an image to the mysql (phpmyadmin) through the Codeigniter-based webservice. The image column in mysql (phpmyadmin) is BLOB.
$data['image'] = str_replace('data:image/jpg;base64,', '', $data['image']);
$data['image'] = str_replace(' ', '+', $data['image']);
$decoded= base64_decode($data['image']);
Then save the decoded file (this is where the permission is denied) :
file_put_contents('C:\xampp\htdocs\project\images', $decoded);
The image file should be saved in the "temp" folder, which is in the same folder with the php file (controller folder). However, the file is never stored (but the other data like name, email is stored on the mysql).
The error i got :
<p>Message: file_put_contents(C:\xampp\htdocs\project\images): failed to open stream: Permission denied</p>
Im kinda stuck now. Please kindly help me.
Thanks for your help