Commit 0563df13 authored by Gudipaty Aniket's avatar Gudipaty Aniket

Added get_file backend

parent d313153d
<?php
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Credentials: true');
header("Access-Control-Allow-Methods: PUT, GET, POST, DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header("Content-Type: application/json; charset=UTF-8");
$postData = file_get_contents("php://input");
$postData = json_decode($postData, true);
$uname = $postData['username'];
$f_path = $postData['file_path'];
$path = "../users/" . $uname . "/" . $f_path;
if(file_exists($path))
{
echo json_encode(file_get_contents($path));
}
else
{
http_response_code(404);
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment