<?php
/**
* @version $Id: class.upload.php 1858 2013-02-06 18:58:49Z lefteris.kavadas $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.net
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die;
// +------------------------------------------------------------------------+
// | class.upload.php |
// +------------------------------------------------------------------------+
// | Copyright (c) Colin Verot 2003-2010. All rights reserved. |
// | Version 0.32 |
// | Last modified 15/01/2013 |
// | Email colin@verot.net |
// | Web http://www.verot.net |
// +------------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License version 2 as |
// | published by the Free Software Foundation. |
// | |
// | 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 the |
// | Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
// | Boston, MA 02111-1307 USA |
// | |
// | Please give credit on sites that use class.upload and submit changes |
// | of the script so other people can use them as well. |
// | This script is free to use, don't abuse. |
// +------------------------------------------------------------------------+
//
/**
* Class upload
*
* @version 0.32
* @author Colin Verot <colin@verot.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @copyright Colin Verot
* @package cmf
* @subpackage external
*/
/**
* Class upload
*
* <b>What does it do?</b>
*
* It manages file uploads for you. In short, it manages the uploaded file,
* and allows you to do whatever you want with the file, especially if it
* is an image, and as many times as you want.
*
* It is the ideal class to quickly integrate file upload in your site.
* If the file is an image, you can convert, resize, crop it in many ways.
* You can also apply filters, add borders, text, watermarks, etc...
* That's all you need for a gallery script for instance. Supported formats
* are PNG, JPG, GIF and BMP.
*
* You can also use the class to work on local files, which is especially
* useful to use the image manipulation features. The class also supports
* Flash uploaders.
*
* The class works with PHP 4 and 5, and its error messages can
* be localized at will.
*
* <b>How does it work?</b>
*
* You instanciate the class with the $_FILES['my_field'] array
* where my_field is the field name from your upload form.
* The class will check if the original file has been uploaded
* to its temporary location (alternatively, you can instanciate
* the class with a local filename).
*
* You can then set a number of processing variables to act on the file.
* For instance, you can rename the file, and if it is an image,
* convert and resize it in many ways.
* You can also set what will the class do if the file already exists.
*
* Then you call the function {@link process} to actually perform the actions
* according to the processing parameters you set above.
* It will create new instances of the original file,
* so the original file remains the same between each process.
* The file will be manipulated, and copied to the given location.
* The processing variables will be reset once it is done.
*
* You can repeat setting up a new set of processing variables,
* and calling {@link process} again as many times as you want.
* When you have finished, you can call {@link clean} to delete
* the original uploaded file.
*
* If you don't set any processing parameters and call {@link process}
* just after instanciating the class. The uploaded file will be simply
* copied to the given location without any alteration or checks.
*
* Don't forget to add <i>enctype="multipart/form-data"</i> in your form
* tag <form> if you want your form to upload the file.
*
* <b>How to use it?</b><br>
* Create a simple HTML file, with a form such as:
* <pre>
* <form enctype="multipart/form-data" method="post" action="upload.php">
* <input type="file" size="32" name="image_field" value="">
* <input type="submit" name="Submit" value="upload">
* </form>
* </pre>
* Create a file called upload.php:
* <pre>
* $handle = new upload($_FILES['image_field']);
* if ($handle->uploaded) {
* $handle->file_new_name_body = 'image_resized';
* $handle->image_resize = true;
* $handle->image_x = 100;
* $handle->image_ratio_y = true;
* $handle->process('/home/user/files/');
* if ($handle->processed) {
* echo 'image resized';
* $handle->clean();
* } else {
* echo 'error : ' . $handle->error;
* }
* }
* </pre>
*
* <b>How to process a file uploaded via XMLHttpRequest?</b><br>
* Use the class as following, the rest being the same as above:
* <pre>
* $handle = new upload('php:'.$_SERVER['HTTP_X_FILE_NAME']);
* </pre>
* Prefixing the argument with "php:" tells the class to retrieve the uploaded data
* in php://input, and the rest is the stream's filename, which is generally in
* $_SERVER['HTTP_X_FILE_NAME']. But you can use any other name you see fit:
* <pre>
* $handle = new upload('php:mycustomname.ext');
* </pre>
*
* <b>How to process local files?</b><br>
* Use the class as following, the rest being the same as above:
* <pre>
* $handle = new upload('/home/user/myfile.jpg');
* </pre>
*
* <b>How to set the language?</b><br>
* Instantiate the class with a second argument being the language code:
* <pre>
* $handle = new upload($_FILES['image_field'], 'fr_FR');
* $handle = new upload('/home/user/myfile.jpg', 'fr_FR');
* </pre>
*
* <b>How to output the resulting file or picture directly to the browser?</b><br>
* Simply call {@link process}() without an argument (or with null as first argument):
* <pre>
* $handle = new upload($_FILES['image_field']);
* header('Content-type: ' . $handle->file_src_mime);
* echo $handle->Process();
* die();
* </pre>
* Or if you want to force the download of the file:
* <pre>
* $handle = new upload($_FILES['image_field']);
* header('Content-type: ' . $handle->file_src_mime);
* header("Content-Disposition: attachment; filename=".rawurlencode($handle->file_src_name).";");
* echo $handle->Process();
* die();
* </pre>
*
* <b>Processing parameters</b> (reset after each process)
* <ul>
* <li><b>{@link file_new_name_body}</b> replaces the name body (default: null)<br>
* <pre>$handle->file_new_name_body = 'new name';</pre></li>
* <li><b>{@link file_name_body_add}</b> appends to the name body (de
没有合适的资源?快使用搜索试试~ 我知道了~
joomla K2 组件 中文版 支持2.5
共515个文件
php:216个
png:88个
ini:84个
需积分: 9 8 下载量 113 浏览量
2014-08-18
13:03:40
上传
评论
收藏 1.47MB ZIP 举报
温馨提示
joomla的K2组件扩展集成中文版汉化包,支持joomla2.5.我目前使用的版本。暂时没发现BUG。如果发现有问题,我会及时替换掉。 如果有朋友发现有BUG,请留言,我会替换掉有BUG的版本。
资源推荐
资源详情
资源评论
收起资源包目录
joomla K2 组件 中文版 支持2.5 (515个子文件)
k2.css 49KB
elfinder.min.css 29KB
k2.css 21KB
style.css 3KB
k2.modules.css 3KB
k2.frontend.css 2KB
k2tags.css 2KB
theme.css 2KB
k2.print.css 609B
k2CalendarLoader.gif 10KB
nicEditorIcons.gif 3KB
videoplayer-bg.gif 2KB
k2.gif 2KB
spinner-mini.gif 2KB
loading.gif 2KB
loader.gif 2KB
progress.gif 2KB
star.gif 1KB
transparent_star.gif 1024B
feed-icon-14x14.gif 1008B
searchLoader.gif 723B
crop.gif 329B
font_increase.gif 197B
font_decrease.gif 138B
blank.gif 43B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 44B
index.html 31B
index.html 31B
index.html 31B
index.html 31B
index.html 31B
en-GB.com_k2.ini 68KB
zh-CN.com_k2.ini 57KB
zh-TW.com_k2.ini 57KB
en-GB.com_k2.ini 8KB
en-GB.mod_k2_tools.ini 7KB
zh-TW.com_k2.ini 7KB
zh-CN.com_k2.ini 7KB
zh-CN.mod_k2_tools.ini 7KB
zh-TW.mod_k2_tools.ini 7KB
en-GB.mod_k2_content.ini 7KB
zh-CN.mod_k2_content.ini 6KB
zh-TW.mod_k2_content.ini 6KB
en-GB.mod_k2_user.ini 4KB
zh-TW.mod_k2_user.ini 4KB
zh-CN.mod_k2_user.ini 4KB
en-GB.mod_k2_comments.ini 4KB
zh-TW.mod_k2_comments.ini 3KB
zh-CN.mod_k2_comments.ini 3KB
en-GB.mod_k2_users.ini 3KB
zh-TW.mod_k2_users.ini 3KB
zh-CN.mod_k2_users.ini 3KB
en-GB.mod_k2_quickicons.ini 2KB
zh-CN.mod_k2_quickicons.ini 2KB
zh-TW.mod_k2_quickicons.ini 2KB
en-GB.mod_k2_stats.ini 1KB
zh-TW.mod_k2_stats.ini 1KB
zh-CN.mod_k2_stats.ini 1KB
en-GB.mod_k2_user.sys.ini 1KB
zh-CN.mod_k2_user.sys.ini 968B
en-GB.plg_search_k2.ini 955B
zh-TW.mod_k2_user.sys.ini 901B
zh-CN.plg_search_k2.ini 851B
zh-TW.plg_search_k2.ini 851B
en-GB.plg_finder_k2.ini 728B
en-GB.mod_k2_users.sys.ini 702B
en-GB.plg_system_k2.ini 695B
en-GB.mod_k2_content.sys.ini 680B
en-GB.com_k2.menu.ini 664B
zh-TW.plg_finder_k2.ini 664B
zh-CN.plg_finder_k2.ini 654B
zh-CN.mod_k2_users.sys.ini 593B
zh-TW.com_k2.menu.ini 584B
zh-CN.com_k2.menu.ini 584B
zh-TW.plg_system_k2.ini 583B
zh-CN.plg_system_k2.ini 583B
zh-CN.mod_k2_content.sys.ini 570B
zh-TW.mod_k2_content.sys.ini 565B
zh-TW.mod_k2_users.sys.ini 560B
en-GB.mod_k2_comments.sys.ini 513B
en-GB.mod_k2_quickicons.sys.ini 490B
en-GB.mod_k2_tools.sys.ini 484B
en-GB.com_k2.j16.ini 439B
zh-TW.mod_k2_comments.sys.ini 439B
en-GB.mod_k2_stats.sys.ini 427B
zh-CN.mod_k2_comments.sys.ini 427B
zh-CN.mod_k2_quickicons.sys.ini 420B
en-GB.plg_user_k2.ini 411B
共 515 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
狼子野心33
- 粉丝: 18
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 目标检测-零售食品LOGO检测数据集-40000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-30000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-20000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 目标检测-零售食品LOGO检测数据集-10000张图-+对应VOC-COCO-YOLO三种格式标签+数据集划分脚本
- 基于GUI+MYSQL+JAVA图书管理系统文档说明+源码(高分大作业项目).zip
- 基于Qt使用C++实现图书管理系统源码+数据库(95分以上).zip
- 基于GUI+MYSQL+JAVA票务管理系统文档介绍+源码+数据库(高分大作业).zip
- 优先编码器除法电微分运算电路 全加器函数发生电路等电路经典Multisim仿真实验源文件合集(25个).zip
- 2331308JS课堂案例.zip
- STM32H750VBT6单片机最小系统开发板AD设计硬件(原理图+PCB+3D封装库)工程文件.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功