D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
www
/
cas
/
application
/
controllers
/
webServices
/
Filename :
FileTransfer.php
back
Copy
<?php /** * Web Service Hanlder For Several Utility Related Module (File Transfer/Downloads Etc.) * * @author Softpro India Pvt. Ltd. */ class FileTransfer extends CI_Controller { public function __construct() { parent::__construct(); } public function copyFileFromURL() { if ($_SERVER["REQUEST_METHOD"] == "POST") { $photographStatus = 0; $signatureStatus = 0; $_POST = json_decode(file_get_contents('php://input'), true); header("Content-Type:image/*"); if (is_array($_POST)) { if (array_key_exists("photograph", $_POST)) { if (file_put_contents("assets/admin/uploads/studentData/" . basename($_POST['photograph']), file_get_contents($_POST['photograph']))) { $photographStatus++; } } if (array_key_exists("signature", $_POST)) { if (file_put_contents("assets/admin/uploads/studentData/" . basename($_POST['signature']), file_get_contents($_POST['signature']))) { $signatureStatus++; } } } echo json_encode(array("photographStatus" => $photographStatus, "signatureStatus" => $signatureStatus)); } } }