From 11afcd780bd1a1bf409794a0ce9b182c87eff970 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Thu, 5 Nov 2015 18:57:04 +0100 Subject: [PATCH] new API feature: pictshare URL to info about the image --- backend.php | 4 ++-- models/pictsharemodel.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend.php b/backend.php index 35c4103..cb30daa 100644 --- a/backend.php +++ b/backend.php @@ -40,7 +40,7 @@ else if($_REQUEST['base64']) $format = $_REQUEST['format']; echo json_encode($pm->uploadImageFromBase64($data,$format)); } -else if($_REQUEST['getsize']) - echo json_encode($pm->getSizeOfURL($_REQUEST['getsize'])); +else if($_REQUEST['geturlinfo']) + echo json_encode($pm->getURLInfo($_REQUEST['geturlinfo'])); else echo json_encode(array('status'=>'ERR')); diff --git a/models/pictsharemodel.php b/models/pictsharemodel.php index 4404abc..ef908a6 100644 --- a/models/pictsharemodel.php +++ b/models/pictsharemodel.php @@ -7,7 +7,7 @@ class PictshareModel extends Model return array('status'=>'ok'); } - function getSizeOfURL($url) + function getURLInfo($url) { $url = rawurldecode($url); $data = $this->urlToData($url); @@ -22,7 +22,7 @@ class PictshareModel extends Model if(file_exists($path)) { $byte = filesize($path); - return array('status'=>'ok','size'=>$byte,'humansize'=>$html->renderSize($byte)); + return array('status'=>'ok','hash'=>$hash,'cachename'=>$file,'size'=>$byte,'humansize'=>$html->renderSize($byte)); } else