本文整理汇总了PHP中Attachment::outputDownload方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachment::outputDownload方法的具体用法?PHP Attachment::outputDownload怎么用?PHP Attachment::outputDownload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachment
的用法示例。
在下文中一共展示了Attachment::outputDownload方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to: |
// | |
// | Free Software Foundation, Inc. |
// | 51 Franklin Street, Suite 330 |
// | Boston, MA 02110-1301, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com> |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
if (@$_GET['cat'] == 'blocked_email') {
$email = Note::getBlockedMessage($_GET['note_id']);
} else {
$email = Support::getFullEmail($_GET['sup_id']);
}
if (!empty($_GET['raw'])) {
Attachment::outputDownload($email, 'message.eml', strlen($email), 'message/rfc822');
} else {
if (!empty($_GET['cid'])) {
list($mimetype, $data) = Mime_Helper::getAttachment($email, $_GET['filename'], $_GET['cid']);
} else {
list($mimetype, $data) = Mime_Helper::getAttachment($email, $_GET['filename']);
}
Attachment::outputDownload($data, $_GET['filename'], strlen($data), $mimetype);
}
示例2: list
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to: |
// | |
// | Free Software Foundation, Inc. |
// | 59 Temple Place - Suite 330 |
// | Boston, MA 02111-1307, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com> |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.get_attachment.php 1.5 03/09/30 18:07:03-00:00 jpradomaia $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.support.php";
include_once APP_INC_PATH . "class.mime_helper.php";
include_once APP_INC_PATH . "db_access.php";
Auth::checkAuthentication(APP_COOKIE);
if (@$HTTP_GET_VARS['cat'] == 'blocked_email') {
$email = Note::getBlockedMessage($HTTP_GET_VARS["note_id"]);
} else {
$email = Support::getFullEmail($HTTP_GET_VARS["sup_id"]);
}
if (!empty($HTTP_GET_VARS['cid'])) {
list($mimetype, $data) = Mime_Helper::getAttachment($email, $HTTP_GET_VARS["filename"], $HTTP_GET_VARS["cid"]);
} else {
list($mimetype, $data) = Mime_Helper::getAttachment($email, $HTTP_GET_VARS["filename"]);
}
Attachment::outputDownload($data, $HTTP_GET_VARS["filename"], strlen($data), $mimetype);
示例3: header
// | 59 Temple Place - Suite 330 |
// | Boston, MA 02111-1307, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com> |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.download.php 1.14 04/01/26 20:37:04-06:00 joao@kickass. $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.attachment.php";
include_once APP_INC_PATH . "db_access.php";
Auth::checkAuthentication(APP_COOKIE);
if (stristr(APP_BASE_URL, 'https:')) {
// fix for IE 5.5/6 with SSL sites
header('Pragma: cache');
}
// fix for IE6 (KB812935)
header('Cache-Control: must-revalidate');
if ($HTTP_GET_VARS['cat'] == 'attachment') {
$file = Attachment::getDetails($HTTP_GET_VARS["id"]);
if (!empty($file)) {
if (!Issue::canAccess($file['iat_iss_id'], Auth::getUserID())) {
$tpl = new Template_API();
$tpl->setTemplate("permission_denied.tpl.html");
$tpl->displayTemplate();
exit;
}
Attachment::outputDownload($file['iaf_file'], $file["iaf_filename"], $file['iaf_filesize'], $file['iaf_filetype']);
}
}
示例4: dirname
// | This program is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to: |
// | |
// | Free Software Foundation, Inc. |
// | 51 Franklin Street, Suite 330 |
// | Boston, MA 02110-1301, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com> |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
if (!Access::canExportData(Auth::getUserID())) {
exit;
}
$csv = base64_decode($_POST['csv_data']);
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
// Date in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// always modified
header('Pragma: no-cache');
header('Cache-Control: must-revalidate, post-check=0,pre-check=0');
$filename = uniqid('csv') . '.xls';
$mimetype = 'application/vnd.ms-excel';
$filesize = strlen($csv);
Attachment::outputDownload($csv, $filename, $filesize, $mimetype);
示例5: dirname
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to: |
// | |
// | Free Software Foundation, Inc. |
// | 51 Franklin Street, Suite 330 |
// | Boston, MA 02110-1301, USA. |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com> |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
if (stristr(APP_BASE_URL, 'https:')) {
// fix for IE 5.5/6 with SSL sites
header('Pragma: cache');
}
// fix for IE6 (KB812935)
header('Cache-Control: must-revalidate');
if ($_GET['cat'] == 'attachment') {
$file = Attachment::getDetails($_GET['id']);
if (!empty($file)) {
if (!Issue::canAccess($file['iat_iss_id'], Auth::getUserID())) {
$tpl = new Template_Helper();
$tpl->setTemplate('permission_denied.tpl.html');
$tpl->displayTemplate();
exit;
}
$force_inline = filter_input(INPUT_GET, 'force_inline');
Attachment::outputDownload($file['iaf_file'], $file['iaf_filename'], $file['iaf_filesize'], $file['iaf_filetype'], $force_inline);
}
}