本文整理汇总了PHP中uploader类的典型用法代码示例。如果您正苦于以下问题:PHP uploader类的具体用法?PHP uploader怎么用?PHP uploader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了uploader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
Yii::import('ext.editMe.vendors.kcfinder.core.*');
Yii::import('ext.editMe.vendors.kcfinder.lib.*');
$uploader = new uploader();
$uploader->upload();
}
开发者ID:syukrikhafidh,项目名称:appdefault,代码行数:7,代码来源:KCFinderUploaderAction.php
示例2: UploadFoto
function UploadFoto()
{
require "modulos/fileupload/fileupload-class.php";
$full = "productos_img/";
//$mini = "productos_img/";
$my_uploader = new uploader();
$success = $my_uploader->upload("file", "", ".jpg");
if ($success) {
$modo = 2;
$success = $my_uploader->save_file($full, $modo);
if (!$success) {
return false;
}
return $my_uploader->file['name'];
}
return false;
}
开发者ID:klich3,项目名称:gPOS,代码行数:17,代码来源:modproductos.php
示例3: uploadImg
private function uploadImg()
{
if (isset($_POST['upfile']) || $_FILES['upfile']) {
header("Content-Type:text/html;charset=utf-8");
error_reporting(E_ERROR | E_WARNING);
$config = array("savePath" => imgPath, "maxSize" => maxSize, "allowFiles" => array(".gif", ".png", ".jpg", ".jpeg", ".bmp"));
$up = new uploader($_SESSION['weixinId'], $this->newsId, "upfile", $config);
$type = $_REQUEST['type'];
$callback = $_GET['callback'];
$info = $up->getFileInfo();
wxlog(json_encode($info));
/**
* 返回数据
*/
if ($callback) {
echo '<script>' . $callback . '(' . json_encode($info) . ')</script>';
} else {
echo json_encode($info);
}
}
}
开发者ID:btbj,项目名称:wechat,代码行数:21,代码来源:newsEdit.php
示例4: numbers
} else {
$data = $my->about;
}
$chars = numbers($config['maxaboutlength']);
$bbcode = initBBCodes();
$inner['bbhtml'] = $bbcode->getbbhtml();
$inner['smileys'] = $bbcode->getsmileyhtml($config['smileysperrow']);
$mymodules->load('editprofile_about_top');
echo $tpl->parse("editprofile/about");
} elseif ($_GET['action'] == "pic2") {
$pic = $gpc->get('pic', none);
if ($my->p['usepic'] == 0) {
errorLogin($lang->phrase('not_allowed'), "editprofile.php");
} elseif (isset($_FILES) && is_array($_FILES['upload']) && !empty($_FILES['upload']['name'])) {
require "classes/class.upload.php";
$my_uploader = new uploader();
$my_uploader->max_filesize($config['avfilesize']);
$my_uploader->max_image_size($config['avwidth'], $config['avheight']);
if ($my_uploader->upload('upload', explode('|', $config['avfiletypes']))) {
$my_uploader->save_file('uploads/pics/', '2');
}
if ($my_uploader->return_error()) {
error($my_uploader->return_error(), 'editprofile.php?action=pic');
} else {
if (file_exists($my->pic)) {
@unlink($my->pic);
}
$ext = $my_uploader->rename_file('uploads/pics/', $my_uploader->file['name'], $my->id);
}
$my->pic = 'uploads/pics/' . $my->id . $ext;
} elseif (!empty($pic) && preg_match('/^(http:\\/\\/|www.)([\\wהצ�ִײ�@\\-_\\.]+)\\:?([0-9]*)\\/(.*)$/', $pic, $url_ary)) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:editprofile.php
示例5: errorLogin
if ($my->p['usepic'] == 0) {
errorLogin($lang->phrase('not_allowed'), "editprofile.php");
}
removeOldImages('uploads/pics/', $my->id);
$db->query("UPDATE {$db->pre}user SET pic = '' WHERE id = '{$my->id}' LIMIT 1");
($code = $plugins->load('editprofile_pic3_end')) ? eval($code) : null;
ok($lang->phrase('editprofile_pic_success'), "editprofile.php?action=pic" . SID2URL_x);
} elseif ($_GET['action'] == "pic2") {
$pic = $gpc->get('pic', none);
if ($my->p['usepic'] == 0) {
errorLogin($lang->phrase('not_allowed'), "editprofile.php");
}
$error = array();
if (isset($_FILES) && is_array($_FILES['upload']) && !empty($_FILES['upload']['name'])) {
require "classes/class.upload.php";
$my_uploader = new uploader();
$my_uploader->max_filesize($config['avfilesize']);
$my_uploader->max_image_size($config['avwidth'], $config['avheight']);
$my_uploader->file_types(explode(',', $config['avfiletypes']));
$my_uploader->set_path('uploads/pics/');
$my_uploader->rename_file($my->id);
if ($my_uploader->upload('upload')) {
removeOldImages('uploads/pics/', $my->id);
if ($my_uploader->save_file()) {
$my->pic = 'uploads/pics/' . $my_uploader->fileinfo('filename');
}
}
if ($my_uploader->upload_failed()) {
$error[] = $my_uploader->get_error();
}
} elseif (!empty($pic) && preg_match(URL_REGEXP, $pic)) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:editprofile.php
示例6: explode
$filesize *= 1024;
$filetypes = explode('|', $filetypes);
foreach ($filetypes as $key => $value) {
if (empty($value)) {
unset($filetypes[$key]);
}
}
$insertuploads = array();
$inserterrors = array();
require "classes/class.upload.php";
$success = 0;
for ($i = 0; $i < $ups; $i++) {
if (empty($_FILES['upload_' . $i]['name'])) {
continue;
}
$my_uploader = new uploader();
$my_uploader->max_filesize($filesize);
$my_uploader->file_types($filetypes);
$my_uploader->set_path($dir . DIRECTORY_SEPARATOR);
if (isset($imgwidth) && isset($imgheight)) {
$my_uploader->max_image_size($imgwidth, $imgheight);
}
if ($my_uploader->upload('upload_' . $i)) {
$my_uploader->save_file();
}
if ($my_uploader->upload_failed()) {
array_push($inserterrors, $my_uploader->get_error());
}
$file = $dir . DIRECTORY_SEPARATOR . $my_uploader->fileinfo('filename');
if (!file_exists($file)) {
$inserterrors[] = $lang->phrase('admin_explorer_file_does_not_exist');
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:explorer.php
示例7: foot
</table>
</form>
<?php
echo foot();
} elseif ($job == 'import2') {
$overwrite = $gpc->get('overwrite', int);
$server = $gpc->get('server', none);
$del = $gpc->get('delete', int);
$inserterrors = array();
if (!empty($_FILES['upload']['name'])) {
$filesize = 1024 * 1024;
$filetypes = array('.zip');
$dir = realpath('temp/');
$insertuploads = array();
require "classes/class.upload.php";
$my_uploader = new uploader();
$my_uploader->max_filesize($filesize);
if ($my_uploader->upload('upload', $filetypes)) {
$my_uploader->save_file($dir, 2);
if ($my_uploader->return_error()) {
array_push($inserterrors, $my_uploader->return_error());
}
} else {
array_push($inserterrors, $my_uploader->return_error());
}
$file = $dir . '/' . $my_uploader->file['name'];
if (!file_exists($file)) {
$inserterrors[] = 'File (' . $file . ') does not exist.';
}
} elseif (file_exists($server)) {
$ext = get_extension($server, true);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:language.php
示例8: incrementFileName
/**
* recursive file name incrementation untill no file with exsiting name
* exists
* @param string intial file name
* @param string this recursions file name
* @param int file version
* @return string new file name
*/
function incrementFileName($origFileName, $newFileName, $version)
{
if (JFile::exists($newFileName)) {
$bits = explode('.', $newFileName);
$ext = array_pop($bits);
$f = implode('.', $bits);
$f = rtrim($f, $version - 1);
$newFileName = $f . $version . "." . $ext;
$version++;
$newFileName = uploader::incrementFileName($origFileName, $newFileName, $version);
}
return $newFileName;
}
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:21,代码来源:uploader.php
示例9: IN
if (file_exists('uploads/topics/' . $row[0])) {
@unlink('uploads/topics/' . $row[0]);
}
}
$db->query('DELETE FROM ' . $db->pre . 'uploads WHERE mid = "' . $upinfo['name'] . '" AND id IN (' . implode(',', $ids) . ')', __LINE__, __FILE__);
viscacha_header('Location: attachments.php?type=' . $_GET['type'] . '&id=' . $_GET['id'] . SID2URL_JS_x);
}
} else {
$insertuploads = array();
$inserterrors = array();
require "classes/class.upload.php";
for ($i = 0; $i < $config['tpcmaxuploads']; $i++) {
if (empty($_FILES['upload_' . $i]['name'])) {
continue;
}
$my_uploader = new uploader();
$my_uploader->max_filesize($config['tpcfilesize']);
$my_uploader->max_image_size($config['tpcwidth'], $config['tpcheight']);
if ($my_uploader->upload('upload_' . $i, explode('|', $config['tpcfiletypes']), 1)) {
$my_uploader->save_file('uploads/topics/', '2');
}
if ($my_uploader->return_error()) {
array_push($inserterrors, $my_uploader->return_error());
}
array_push($insertuploads, $my_uploader->file['name']);
}
if (count($inserterrors) > 0) {
error($inserterrors, 'attachments.php?type=' . $_GET['type'] . '&id=' . $_GET['id'] . SID2URL_x);
}
if ($_GET['type'] == 'edit' && ($my->mp[0] == 1 || $upinfo['name'] == $my->id)) {
$upper = $upinfo['name'];
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:attachments.php
示例10: uploader
<?php
/** This file is part of KCFinder project
*
* @desc Upload calling script
* @package KCFinder
* @version 2.51
* @author Pavel Tzonkov <[email protected]>
* @copyright 2010, 2011 KCFinder Project
* @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
* @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
* @link http://kcfinder.sunhater.com
*/
require "core/autoload.php";
$uploader = new uploader($modx);
$uploader->upload();
开发者ID:radist,项目名称:modx.evo.custom,代码行数:16,代码来源:upload.php
示例11: component
<tr>
<td class="mbox" width="50%">Packed Component:<br><span class="stext">Compressed file containing the component (.zip). You should install only components from confidential sources!</td>
<td class="mbox" width="50%"><input type="file" name="upload" size="60" /></td>
</tr>
<tr>
<td class="ubox" width="100%" colspan="2" align="center"><input type="submit" name="Submit" value="Upload"></td>
</tr>
</table>
</form>
<?php
echo foot();
} elseif ($job == 'com_add2') {
echo head();
if (isset($_FILES) && is_array($_FILES['upload']) && $_FILES['upload']['name']) {
require "classes/class.upload.php";
$my_uploader = new uploader();
if ($my_uploader->upload('upload', array('.zip'))) {
$my_uploader->save_file('temp/', '2');
}
if ($my_uploader->return_error()) {
error('admin.php?action=cms&job=com_add', $my_uploader->return_error());
} else {
$tdir = "temp/" . time();
$filesystem->mkdir($tdir);
if (!is_dir($tdir)) {
error('admin.php?action=cms&job=com_add', 'Directory could not be created for extraction.');
}
include 'classes/class.zip.php';
$archive = new PclZip('temp/' . $my_uploader->file['name']);
if ($archive->extract(PCLZIP_OPT_PATH, $tdir) == 0) {
error('admin.php?action=cms&job=com_add', $archive->errorInfo(true));
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:cms.php
示例12: elseif
} elseif ($job == 'query') {
echo head();
exec_query_form();
echo foot();
} elseif ($job == 'query2') {
echo head();
$type = $gpc->get('type', int);
if ($type == 1) {
$filetypes = array('zip', 'sql');
$dir = 'temp/';
$inserterrors = array();
require "classes/class.upload.php";
if (empty($_FILES['upload']['name'])) {
$inserterrors[] = 'No file specified.';
}
$my_uploader = new uploader();
$my_uploader->max_filesize(ini_maxupload());
$my_uploader->file_types($filetypes);
$my_uploader->set_path($dir);
if ($my_uploader->upload('upload')) {
if ($my_uploader->save_file()) {
$file = $dir . $my_uploader->fileinfo('filename');
if (!file_exists($file)) {
$inserterrors[] = 'File (' . $file . ') does not exist.';
}
}
}
if ($my_uploader->upload_failed()) {
array_push($inserterrors, $my_uploader->get_error());
}
if (count($inserterrors) > 0) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:db.php
示例13: menu
<!DOCTYPE HTML>
<html>
<head>
<title>Загрузка и обработка изображения</title>
<?php
require_once "functions.php";
$menu = new menu();
if (!empty($_FILES)) {
$uploader = new uploader();
$uploader->checkAndMove();
}
if (!empty($_SESSION['filename'])) {
$image = new image();
$image->getDimensions();
if (!empty($_POST['imageCrop'])) {
$image->cropImage();
}
}
?>
</head>
<body>
<center>
<h1>Загрузка и обработка изображения</h1>
<?php
$menu->showUploadMenu();
if (!empty($_SESSION['filename'])) {
$menu->showCropMenu();
$image->checkCrop($menu);
$menu->showSepia();
if (!empty($_GET['sepia']) and $_GET['sepia'] == 'yes') {
$image->applySepia();
开发者ID:dmitrii89,项目名称:PHP_image_processing,代码行数:31,代码来源:index.php
示例14: Object
<?php
include_once "act.portfolio.php";
// Файл для обработки логики
if ($user->login == $_SESSION['login']) {
uploader::init(array(), $templates, 'portfolio');
}
?>
<script type="text/javascript">
var categoryList = new Object();
var currencyList = {0:"USD", 1:"Евро", 2:"Руб"}
var timeTypeList = {0:"в часах", 1:"в днях", 2:"в месяцах", 3:"в минутах"}
</script>
<?php
if ($_SESSION['login'] == $user->login) {
?>
<?php
if ($user->is_pro != 't' && (int) $user->spec == 0) {
?>
<div class="b-fon b-fon_pad_20">
<div class="b-fon__body b-fon__body_pad_10 b-fon__body_padleft_30 b-fon__body_fontsize_13 b-fon__body_bg_ffeeeb">
<span class="b-icon b-icon_sbr_rattent b-icon_margleft_-25"></span><a class="b-layout__link" href="/users/<?php
echo $user->login;
?>
/setup/specsetup/">Выберите специализацию</a>. Это небходимо, чтобы попасть в каталог фрилансеров, в котором вас найдут заказчики
</div>
</div>
<?php
} elseif ($user->is_pro != 't' && (int) $user->spec != 0) {
?>
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:tpl.portfolio.pro.php
示例15: session_start
session_start();
// included files
include "../../../connection/phpmysqlconnect.php";
include "../../../library/CRUD_lib.php";
include "../../../library/miss_lib.php";
// post data
$user_id = $_POST['user_id'];
$month = $_POST['month'];
$year = $_POST['year'];
$modifier = $_SESSION["user"];
// File processing
$ext_array = array("xls", "csv", "xlsx");
$mime_array = array("application/vnd.ms-excel", "text/csv", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
$location = "../../media/performance-sheet/";
$file = new uploader();
if (is_uploaded_file($_FILES['file']['tmp_name'])) {
if ($file->upload_validate($_FILES['file'], $ext_array, $mime_array) == true) {
$file_name = $file->upload($_FILES['file'], $location);
// insertion
$column = array('performance_sheet', 'user_id', 'month', 'year', 'uploaded_by', 'modified_by');
$value = array("{$file_name}", "{$user_id}", "{$month}", "{$year}", "{$modifier}", "{$modifier}");
$insert = new crud($conn, 'employee_performance', $column, $value);
$insert->insert();
$move = new alert_redirect();
$move->moveWithAlert('New Performance Sheet has been added', '../pages/addperformance.php');
} else {
$move = new alert_redirect();
$move->moveWithAlert('File Extension not valid', '../pages/addperformance.php');
}
$move = new alert_redirect();
开发者ID:samtherock,项目名称:Optamac_final,代码行数:30,代码来源:add_performance.php
示例16: viscacha_header
$slog->updatelogged();
$db->close();
viscacha_header('Location: attachments.php?type=' . $_GET['type'] . '&id=' . $_GET['id'] . SID2URL_JS_x);
exit;
}
} else {
$insertuploads = array();
$inserterrors = array();
require "classes/class.upload.php";
($code = $plugins->load('attachments_upload_save_add_start')) ? eval($code) : null;
for ($i = 0; $i < $config['tpcmaxuploads']; $i++) {
$field = "upload_{$i}";
if (empty($_FILES[$field]['name'])) {
continue;
}
$my_uploader = new uploader();
$my_uploader->max_filesize($config['tpcfilesize']);
$my_uploader->max_image_size($config['tpcwidth'], $config['tpcheight']);
$my_uploader->file_types(explode(',', $config['tpcfiletypes']));
$my_uploader->set_path('uploads/topics/');
($code = $plugins->load('attachments_upload_add_prepare')) ? eval($code) : null;
if ($my_uploader->upload($field)) {
if ($my_uploader->save_file()) {
array_push($insertuploads, array('file' => $my_uploader->fileinfo('name'), 'source' => $my_uploader->fileinfo('filename')));
}
}
if ($my_uploader->upload_failed()) {
array_push($inserterrors, $my_uploader->get_error());
}
}
if ($_GET['type'] == 'edit' && ($my->mp[0] == 1 || $upinfo['name'] == $my->id)) {
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:attachments.php
示例17: array
<?php
if (hasPermissions('articles')) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/uploader/uploader.php";
$templates = array(uploader::getTemplate('uploader', 'wysiwyg/'), uploader::getTemplate('uploader.file', 'wysiwyg/'), uploader::getTemplate('uploader.popup'));
uploader::init(array(), $templates, 'wysiwyg');
}
?>
<script>
window.addEvent('domready', function() {
$$('.ai-form input[type=file]').each( function (el) {
articlesFileInput(el);
});
<?php
if (hasPermissions('articles')) {
?>
CKEDITOR.config.customConfig = '/scripts/ckedit/config_admin.js';<?php
}
?>
CKEDITOR.replace('msgtext', {
toolbar : 'Articles',
// enterMode : CKEDITOR.ENTER_BR,
// shiftEnterMode : CKEDITOR.ENTER_P,
format_tags : 'p;h1;h2;h3;h4;h5;h6',
width: '',
linkShowAdvancedTab: false,
linkShowTargetTab: false
});
// CKEDITOR.replace('short', {
// toolbar : 'Articles',
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:form.php
示例18: implode
}
$n[] = implode('|', $row);
}
$filesystem->file_put_contents('data/feedcreator.inc.php', implode("\n", $n));
}
viscacha_header('Location: admin.php?action=misc&job=feedcreator');
} elseif ($job == 'feedcreator_add') {
echo head();
$name = $gpc->get('name', str);
$class = $gpc->get('class', str);
$active = $gpc->get('active', str);
$dl = $gpc->get('dl', str);
$dir = realpath('./classes/feedcreator/');
$inserterrors = array();
require "classes/class.upload.php";
$my_uploader = new uploader();
$my_uploader->max_filesize(200 * 1024);
if ($my_uploader->upload('upload', array('.php'))) {
if (strlen($my_uploader->return_error()) > 0) {
array_push($inserterrors, $my_uploader->return_error());
}
$my_uploader->save_file($dir, 2);
$file = $my_uploader->file['name'];
} else {
if (strlen($my_uploader->return_error()) > 0) {
array_push($inserterrors, $my_uploader->return_error());
} else {
if (count($inserterrors) == 0) {
array_push($inserterrors, 'An unexpected error occurred');
}
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:misc.php
示例19: chdir
<?php
chdir('../../');
include 'pv_core.php';
CheckLogin();
LoadUserlanguage();
if (isset($_FILES) && count($_FILES) > 0) {
$path = '../' . $Cfg['upload_path'];
require_once 'includes/fileupload-class.php';
$lang = str_replace("_utf8", "", $Users[$Pivot_Vars['user']]['language']);
$my_uploader = new uploader($lang);
// OPTIONAL: set the max filesize of uploadable files in bytes
$my_uploader->max_filesize($Cfg['max_filesize']);
// UPLOAD the file
if ($my_uploader->upload('userfile', $Cfg['upload_accept'], $Cfg['upload_extension'])) {
$success = $my_uploader->save_file($path, $Cfg['upload_save_mode'], 1);
}
}
if (isset($_GET['f_target'])) {
$target = $_GET['f_target'];
} else {
$target = $_POST['f_target'];
}
if (isset($_GET['f_text'])) {
$text = urldecode($_GET['f_text']);
} else {
$text = $_POST['f_text'];
}
if (!isset($Users[$Pivot_Vars['user']]['wysiwyg'])) {
$useWysiwyg = $Cfg['wysiwyg_editor'] == 1 ? TRUE : FALSE;
} else {
开发者ID:wborbajr,项目名称:TecnodataApp,代码行数:31,代码来源:insert_image.php
示例20: array
<?php
include "../../connection/phpmysqlconnect.php";
include "../../lib/CRUD_lib.php";
include "../../lib/miss_lib.php";
// post data
// File processing
$ext_array = array("jpeg", "jpg", "png");
$mime_array = array("image/jpeg", "image/jpg", "image/png");
$location = "../../media/featured_product/";
$image = new uploader();
if ($image->upload_validate($_FILES['files'], $ext_array, $mime_array) == true) {
$image_name = $image->upload($_FILES['files'], $location);
$column = array('logo');
$value = array($image_name);
$insert = new crud($conn, 'featured-product', $column, $value);
$insert->insert();
$move = new alert_redirect();
$move->moveWithAlert('Logo has been added', '../../pages/distributor-logo.php');
}
$move->moveWithAlert('Error in uploading image', '../../pages/distributor-logo.php');
开发者ID:AbhishekShetty08,项目名称:mars-petrochem,代码行数:21,代码来源:featured_product.php
注:本文中的uploader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论