mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-15 12:38:01 +00:00
new API feature: pictshare URL to info about the image
This commit is contained in:
@@ -40,7 +40,7 @@ else if($_REQUEST['base64'])
|
|||||||
$format = $_REQUEST['format'];
|
$format = $_REQUEST['format'];
|
||||||
echo json_encode($pm->uploadImageFromBase64($data,$format));
|
echo json_encode($pm->uploadImageFromBase64($data,$format));
|
||||||
}
|
}
|
||||||
else if($_REQUEST['getsize'])
|
else if($_REQUEST['geturlinfo'])
|
||||||
echo json_encode($pm->getSizeOfURL($_REQUEST['getsize']));
|
echo json_encode($pm->getURLInfo($_REQUEST['geturlinfo']));
|
||||||
else
|
else
|
||||||
echo json_encode(array('status'=>'ERR'));
|
echo json_encode(array('status'=>'ERR'));
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class PictshareModel extends Model
|
|||||||
return array('status'=>'ok');
|
return array('status'=>'ok');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSizeOfURL($url)
|
function getURLInfo($url)
|
||||||
{
|
{
|
||||||
$url = rawurldecode($url);
|
$url = rawurldecode($url);
|
||||||
$data = $this->urlToData($url);
|
$data = $this->urlToData($url);
|
||||||
@@ -22,7 +22,7 @@ class PictshareModel extends Model
|
|||||||
if(file_exists($path))
|
if(file_exists($path))
|
||||||
{
|
{
|
||||||
$byte = filesize($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
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user