Beispiel #1
0
function handleGetPhoto($token, $photo)
{
    $owner = OC_Gallery_Sharing::getTokenOwner($token);
    $view = OCP\Files::getStorage('files');
    $file = $view->fopen(urldecode($photo), 'r');
    header('Content-Type: ' . OC_Image::getMimeTypeForFile($file));
    OCP\Response::sendFile($file);
}
Beispiel #2
0
function handleGetPhoto($token, $photo)
{
    $owner = OC_Gallery_Sharing::getTokenOwner($token);
    $file = OCP\Config::getSystemValue("datadirectory", OC::$SERVERROOT . "/data") . '/' . $owner . '/files' . urldecode($photo);
    header('Content-Type: ' . OC_Image::getMimeTypeForFile($file));
    OCP\Response::sendFile($file);
}