<?php
/*
* jQuery File Upload Plugin PHP Class 6.1.2
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
class UploadHandler
{
protected $options;
// PHP File Upload error message codes:
// http://php.net/manual/en/features.file-upload.errors.php
protected $error_messages = array(
1 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini',
2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
3 => 'The uploaded file was only partially uploaded',
4 => 'No file was uploaded',
6 => 'Missing a temporary folder',
7 => 'Failed to write file to disk',
8 => 'A PHP extension stopped the file upload',
'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',
'max_file_size' => 'File is too big',
'min_file_size' => 'File is too small',
'accept_file_types' => 'Filetype not allowed',
'max_number_of_files' => 'Maximum number of files exceeded',
'max_width' => 'Image exceeds maximum width',
'min_width' => 'Image requires a minimum width',
'max_height' => 'Image exceeds maximum height',
'min_height' => 'Image requires a minimum height'
);
function __construct($options = null, $initialize = true) {
$this->options = array(
'script_url' => $this->get_full_url().'/',
'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/files/',
'upload_url' => $this->get_full_url().'/files/',
'user_dirs' => false,
'mkdir_mode' => 0755,
'param_name' => 'files',
// Set the following option to 'POST', if your server does not support
// DELETE requests. This is a parameter sent to the client:
'delete_type' => 'DELETE',
'access_control_allow_origin' => '*',
'access_control_allow_credentials' => false,
'access_control_allow_methods' => array(
'OPTIONS',
'HEAD',
'GET',
'POST',
'PUT',
'PATCH',
'DELETE'
),
'access_control_allow_headers' => array(
'Content-Type',
'Content-Range',
'Content-Disposition'
),
// Enable to provide file downloads via GET requests to the PHP script:
'download_via_php' => false,
// Defines which files can be displayed inline when downloaded:
'inline_file_types' => '/\.(gif|jpe?g|png)$/i',
// Defines which files (based on their names) are accepted for upload:
'accept_file_types' => '/.+$/i',
// The php.ini settings upload_max_filesize and post_max_size
// take precedence over the following max_file_size setting:
'max_file_size' => null,
'min_file_size' => 1,
// The maximum number of files for the upload directory:
'max_number_of_files' => null,
// Image resolution restrictions:
'max_width' => null,
'max_height' => null,
'min_width' => 1,
'min_height' => 1,
// Set the following option to false to enable resumable uploads:
'discard_aborted_uploads' => true,
// Set to true to rotate images based on EXIF meta data, if available:
'orient_image' => false,
'image_versions' => array(
// Uncomment the following version to restrict the size of
// uploaded images:
/*
'' => array(
'max_width' => 1920,
'max_height' => 1200,
'jpeg_quality' => 95
),
*/
// Uncomment the following to create medium sized images:
/*
'medium' => array(
'max_width' => 800,
'max_height' => 600,
'jpeg_quality' => 80
),
*/
'thumbnail' => array(
'max_width' => 80,
'max_height' => 80
)
)
);
if ($options) {
$this->options = array_merge($this->options, $options);
}
if ($initialize) {
$this->initialize();
}
}
protected function initialize() {
switch ($_SERVER['REQUEST_METHOD']) {
case 'OPTIONS':
case 'HEAD':
$this->head();
break;
case 'GET':
$this->get();
break;
case 'PATCH':
case 'PUT':
case 'POST':
$this->post();
break;
case 'DELETE':
$this->delete();
break;
default:
$this->header('HTTP/1.1 405 Method Not Allowed');
}
}
protected function get_full_url() {
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
return
($https ? 'https://' : 'http://').
(!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').
(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].
($https && $_SERVER['SERVER_PORT'] === 443 ||
$_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).
substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));
}
protected function get_user_id() {
@session_start();
return session_id();
}
protected function get_user_path() {
if ($this->options['user_dirs']) {
return $this->get_user_id().'/';
}
return '';
}
protected function get_upload_path($file_name = null, $version = null) {
$file_name = $file_name ? $file_name : '';
$version_path = empty($version) ? '' : $version.'/';
return $this->options['upload_dir'].$this->get_user_path()
.$version_path.$file_name;
}
protected function get_query_separator($url) {
return strpos($url, '?') === false ? '?' : '&';
}
protected function get_download_url($file_name, $version = null) {
if ($this->options['download_via_php']) {
$url = $this->options['script_url']
.$this->get_query_separator($this->options['script_url'])
.'file='.rawurlencode($file_name);
if ($version) {
$url .= '&version='.rawurlencode($version);
}
return $url.'&download=1';
}
$version_path = empty($version) ? '' : rawurlencode($version).'/';
return $this->options['upload_url'].$this->get_user_path()
.$version_path.rawurlencode($file_name);
}
protected function set_file_delete_properties($file) {
$file->delete_url = $this->options['script_url']
.$this->get_query_separator($this->options['script_url'])
.'file='.rawurlencode($file->name);
$file->delete_type = $this->options['delete_type'];
if ($file->delete_type !== 'DELETE') {
$file->delete_url .= '&_method=DELETE';
}
if ($this->options['access_control_allow_credentials']) {
$file->delete_with_credentials = true;
}
}
// Fix for overflowing signed 32 bit integers,
// works for sizes up to 2^32-1 bytes (4 GiB - 1):
protected function fix_integer_overflow($size) {
if ($size < 0) {
$size += 2.0 * (PHP_INT_MAX + 1);
}
return $size;
}
protected function get_file_size($file_
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
采用SpringBoot+Spring+Mybatis+Thyeleaf实现的在线学习系统,一共2个身份。 管理员登录系统后可以管理所有用户信息,管理角色信息,添加修改管理课件信息,学生学习培训批次管理,成绩导入管理 学生登录系统后可以查询自己的个人信息,查询课件列表学习,查询我的培训记录,查询自己的成绩 采用SpringBoot框架实现 前台模板用的thymeleaf 数据库层采用mybatis框架 注解模式 登录地址: http://localhost:8080/th/login 管理员账号和密码: admin admin 学生登录账号: 1314 密码: 123456
资源推荐
资源详情
资源评论
收起资源包目录
基于SpringBoot课程在线学习系统设计毕业论文源码 (1504个子文件)
ExcelUtil.class 5KB
StudentController.class 3KB
Batchlmpl.class 3KB
LoginController.class 3KB
CourseresoureController.class 3KB
Batchmapper.class 2KB
ExamscoreController.class 2KB
BatchController.class 2KB
Courseresoure.class 2KB
Sysuser.class 2KB
RoleController.class 2KB
Sysuserlmpl.class 2KB
StudyrecordController.class 2KB
CourseController.class 2KB
Sysusermapper.class 2KB
Courseresourelmpl.class 2KB
Examscorelmpl.class 2KB
Studyrecord.class 2KB
Sysrolelmpl.class 2KB
Courseinfolmpl.class 1KB
Examscoremapper.class 1KB
Sysrolemapper.class 1KB
Studyrecordlmpl.class 1KB
Studybatch.class 1KB
Batchservice.class 1KB
Courseresouremapper.class 1KB
Courseinfomapper.class 1KB
Studyrecordmapper.class 1KB
Examscore.class 1KB
StudyApplicationTests.class 1KB
Courseinfo.class 971B
Sysrole.class 946B
Coureseresourebatch.class 781B
HomeController.class 720B
Userbatch.class 715B
StudyApplication.class 706B
Courseresoureservice.class 589B
Sysservice.class 580B
Examscoreservice.class 559B
Courseinfoservice.class 538B
Sysroleservice.class 530B
Studyrecordservice.class 527B
.classpath 1KB
mvnw.cmd 5KB
morris.grid.coffee 12KB
morris.grid.coffee 12KB
morris.line.coffee 12KB
morris.line.coffee 12KB
line_spec.coffee 8KB
line_spec.coffee 8KB
set_data_spec.coffee 7KB
set_data_spec.coffee 7KB
label_series_spec.coffee 6KB
label_series_spec.coffee 6KB
morris.donut.coffee 5KB
morris.donut.coffee 5KB
morris.bar.coffee 5KB
morris.bar.coffee 5KB
jquery.easy-pie-chart.coffee 5KB
jquery.easy-pie-chart.coffee 5KB
donut_spec.coffee 2KB
donut_spec.coffee 2KB
hover_spec.coffee 2KB
hover_spec.coffee 2KB
area_spec.coffee 2KB
area_spec.coffee 2KB
parse_time_spec.coffee 2KB
parse_time_spec.coffee 2KB
morris.area.coffee 2KB
morris.area.coffee 2KB
bar_spec.coffee 2KB
bar_spec.coffee 2KB
colours.coffee 1KB
commas_spec.coffee 1KB
commas_spec.coffee 1KB
colours.coffee 1KB
auto_grid_lines_spec.coffee 1KB
auto_grid_lines_spec.coffee 1KB
morris.hover.coffee 1KB
morris.hover.coffee 1KB
morris.coffee 1006B
morris.coffee 1006B
pad_spec.coffee 588B
pad_spec.coffee 588B
y_label_format_spec.coffee 443B
y_label_format_spec.coffee 443B
placeholder.coffee 162B
placeholder.coffee 162B
bootstrap-theme.css 116KB
bootstrap-theme.css 116KB
style.css 96KB
style.css 96KB
bootstrap.min.css 95KB
bootstrap.min.css 95KB
loaders.css 56KB
loaders.css 56KB
jquery-ui-1.10.1.custom.css 31KB
jquery-ui-1.10.1.custom.css 31KB
editor_ie7.css 29KB
editor_ie7.css 29KB
共 1504 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
结冰架构
- 粉丝: 917
- 资源: 28万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 案例分析:研发人员绩效和薪酬管理的困境.doc
- 企业中薪酬管理存在的问题分析及对策.doc
- 员工年度薪酬收入结构分析报告.doc
- 薪酬分析报告.docx
- 西门子S7-1200控制四轴伺服程序案例: 1.内容涵盖伺服,步进点动,回原,相对定位,绝对定位,速度模式控制 特别适合学习伺服和步进的朋友们 PTO伺服轴脉冲定位控制+速度模式控制+扭矩模式; 2
- 企业公司薪酬保密协议.doc
- 薪酬保密制度 (1).docx
- 薪酬保密管理规定制度.doc
- 薪酬保密制度.docx
- 薪酬保密协议书.docx
- 薪酬保密承诺书.docx
- 薪酬管理制度.doc
- 员工工资薪酬保密协议.docx
- 员工工资保密暂行管理条例.docx
- 员工薪酬保密协议.doc
- 1Redis基础认识与安装.html
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页