Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

admin/customimage.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: customimage.php 7514 2001-09-27 11:48:27Z br $
5 //
6 // Created on: <19-Sep-2001 18:47:17 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27
28 // include_once( "ezimagecatalogue/classes/ezimage.php" );
29 // include_once( "ezimagecatalogue/classes/ezimagevariation.php" );
30
31
32 $image = new eZImage();
33
34 if ( $image->get( $ImageID ) )
35 {
36 if ( is_numeric( $ImageWidth ) and is_numeric( $ImageHeight ) )
37 {
38 $variation =& $image->requestImageVariation( $ImageWidth, $ImageHeight );
39
40 $fp = fopen( $variation->imagePath(), "r");
41
42 $fileSize = eZPBFile::filesize( $variation->imagePath() );
43 $originalFileName = $image->originalFileName();
44
45 ob_end_clean();
46
47 Header("Content-type: image/jpeg");
48 Header("Content-length: $fileSize");
49 Header("Content-disposition: attachment; filename=\"$originalFileName\"");
50
51 fpassthru( $fp );
52 exit();
53 }
54
55 }
56
57 die( "Image not found" );
58
59 ?>
$image
$image
Definition: admin/customimage.php:32
eZImage
Definition: ezimage.php:95
eZPBFile\filesize
static filesize( $filename)
Definition: ezpbfile.php:339
$ImageID
$ImageID
Definition: companytypelist.php:201
$fp
$fp
Definition: export.php:97
$originalFileName
else $originalFileName
Definition: ezfilemanager/user/filedownload.php:48
$fileSize
if(eZObjectPermission::hasPermission( $image->id(), "imagecatalogue_image", "r", $user)==false) $fileSize
Definition: ezimagecatalogue/admin/filedownload.php:51
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.