<?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_
没有合适的资源?快使用搜索试试~ 我知道了~
javaweb项目在线学习系统SpringBoot+Mybatis+Thyeleaf-java课程设计毕业设计学习管理系统开发
共1507个文件
js:586个
html:214个
png:162个
需积分: 0 0 下载量 156 浏览量
更新于2024-10-18
收藏 23.2MB ZIP 举报
本资源使用Spring Boot框架开发,集成MyBatis作为持久层框架,前端采用Thymeleaf模板引擎。项目功能完善,代码清晰,结构合理,适合用于Java课程设计和毕业设计的开发参考。本项目不仅帮助在校大学生理解和掌握Java Web开发技术,还为Java技术爱好者提供了一个学习和实践Spring Boot、MyBatis、Thymeleaf组合应用的优秀范例。通过本项目,学习者可以深入了解现代在线教育系统的开发流程。
收起资源包目录
javaweb项目在线学习系统SpringBoot+Mybatis+Thyeleaf-java课程设计毕业设计学习管理系统开发 (1507个子文件)
StudentController.class 6KB
CourseresoureController.class 5KB
LoginController.class 5KB
ExamscoreController.class 5KB
BatchController.class 5KB
ExcelUtil.class 5KB
Batchlmpl.class 3KB
RoleController.class 3KB
StudyrecordController.class 3KB
Batchmapper.class 3KB
CourseController.class 3KB
Courseresoure.class 2KB
Sysuser.class 2KB
Sysuserlmpl.class 2KB
Sysusermapper.class 2KB
Courseresourelmpl.class 2KB
Examscorelmpl.class 2KB
Studyrecord.class 2KB
Sysrolelmpl.class 2KB
Batchservice.class 2KB
Courseinfolmpl.class 2KB
Courseresouremapper.class 2KB
Studybatch.class 1KB
Studyrecordlmpl.class 1KB
Examscoremapper.class 1KB
Sysrolemapper.class 1KB
Courseinfomapper.class 1KB
Examscore.class 1KB
Studyrecordmapper.class 1KB
Courseinfo.class 1023B
Sysrole.class 998B
Coureseresourebatch.class 822B
Userbatch.class 756B
HomeController.class 750B
StudyApplication.class 736B
Sysservice.class 723B
Courseresoureservice.class 674B
Examscoreservice.class 669B
Sysroleservice.class 640B
StudyApplicationTests.class 625B
Courseinfoservice.class 621B
Studyrecordservice.class 599B
.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
commas_spec.coffee 1KB
colours.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
共 1507 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源推荐
资源预览
资源评论
5星 · 资源好评率100%
143 浏览量
182 浏览量
2024-10-18 上传
167 浏览量
128 浏览量
189 浏览量
5星 · 资源好评率100%
148 浏览量
163 浏览量
144 浏览量
2024-10-21 上传
2024-10-18 上传
189 浏览量
199 浏览量
2024-10-18 上传
122 浏览量
2024-10-18 上传
5星 · 资源好评率100%
188 浏览量
2024-10-18 上传
160 浏览量
5星 · 资源好评率100%
111 浏览量
103 浏览量
127 浏览量
171 浏览量
5星 · 资源好评率100%
161 浏览量
资源评论
csm2017
- 粉丝: 14
- 资源: 111
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 蚁群算法小程序-matlab
- 粒子群算法小程序-matlab
- 《新能源接入的电力市场主辅联合出清》 出清模型以考虑安全约束的机组组合模型(SCUC)和经济调度模型(SCED)组成 程序基于IEEE30节点编写,并接入风电机组参与电力市场,辅助服务市场为备用市场
- 个人创作原画作品,禁止盗用
- 遗传算法程序-matlab
- 游戏人物检测15-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- Windows 7安装NET补丁
- 高动态导航技术全套技术资料.zip
- cms测试练习项目(linux系统部署)
- 游戏人物检测15-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord数据集合集.rar
- 名城小区物业管理-JAVA-基于Spring boot的名城小区物业管理系统设计实现(毕业论文+开题)
- 多媒体素材库-JAVA-基于springboot的多媒体素材库的开发与应用(毕业论文)
- 大学生心理健康管理-JAVA-基于springBoot大学生心理健康管理系统的设计与实现(毕业论文)
- 论坛系统-JAVA-基于SpringBoot的论坛系统设计与实现(毕业论文+开题+PPT)
- 游戏人物检测17-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 大学生智能消费记账-JAVA-springboot205大学生智能消费记账系统的设计与实现(毕业论文)
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功