コード例 #1
0
ファイル: sharing.php プロジェクト: blablubli/owncloudapps
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);
}
コード例 #2
0
ファイル: sharing.php プロジェクト: noci2012/owncloud
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);
}