umer936/cakephp-jquery-file-upload
最新稳定版本:v3
Composer 安装命令:
composer require umer936/cakephp-jquery-file-upload
包简介
Cakephp 5.x Jquery File Upload
关键字:
README 文档
README
This is a Cakephp 5.x vendor/plugin for blueimp jquery file upload widget https://github.com/blueimp/jQuery-File-Upload
Requirements
- Cakephp 4.x
- Blueimp Jquery File Upload - https://github.com/blueimp/jQuery-File-Upload (dependency is added into the plugin's composer, so it wil be automaticaly installed)
Installation
1) Installation is done by composer: add the following into your main composer.json (inside require) and then run composer update
"umer936/cakephp-jquery-file-upload": "^2.0"
To use the css and js files from the original library, they are being copied to plugin's webroot directory: for that inside your application's main composer.json the following should be added
"scripts": {
"post-update-cmd": "CakephpJqueryFileUpload\\Console\\Installer::postUpdate"
},
2) Load Plugin from bootstrap, and add component into controller, helper - to AppView
// bootstrap.php
Plugin::load('CakephpJqueryFileUpload');
// inside your controller's initialize
$this->loadComponent('CakephpJqueryFileUpload.JqueryFileUpload');
// inside AppView.php initialize
$this->loadHelper('CakephpJqueryFileUpload.JqueryFileUpload');
3) To add the UploadHelper class to autoload classmap, add this into your main composer - under autoload, same level as psr-4
"classmap": [
"vendor/blueimp/jquery-file-upload/server/php"
]
and run composer dump-autoload
4) Simple setup example
<?php echo $this->JqueryFileUpload->loadCss(); ?>
<?php echo $this->JqueryFileUpload->loadScripts(); ?>
<span class="btn btn-success fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Select files...</span>
<!-- The file input field used as target for the file upload widget -->
<input id="fileupload" type="file" name="files[]" multiple>
</span>
<script type="text/javascript">
$(function () {
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload({
// Uncomment the following to send cross-domain cookies:
//xhrFields: {withCredentials: true},
url: '/myController/myAction'
});
});
</script>
inside your myAction
// example options
$options = array(
'max_file_size' => 2048000,
'max_number_of_files' => 10,
'access_control_allow_methods' => array(
'POST'
),
'access_control_allow_origin' => Router::fullBaseUrl(),
'accept_file_types' => '/\.(jpe?g|png)$/i',
'upload_dir' => WWW_ROOT . 'files' . DS . 'uploads' . DS,
'upload_url' => '/files/uploads/',
'print_response' => false
);
$result = $this->JqueryFileUpload->upload($options);
For full $options please refer to https://github.com/blueimp/jQuery-File-Upload
License
MIT
umer936/cakephp-jquery-file-upload 适用场景与选型建议
umer936/cakephp-jquery-file-upload 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 107 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「jquery」 「cakephp」 「file-upload」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 umer936/cakephp-jquery-file-upload 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 umer936/cakephp-jquery-file-upload 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 umer936/cakephp-jquery-file-upload 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Integrates the rekalogika/file library into the Symfony framework.
Upload files using Symfony Form, FilePond, and the rekalogika/file framework
A powerful chunked file upload field for Filament using Uppy.js with S3, remote sources (Google Drive, OneDrive, Dropbox), webcam, screen capture, audio recording, image editing and more.
Symfony bundle for automatic file upload handling on Doctrine ORM entities with S3, CDN, and multiple storage support
统计信息
- 总下载量: 107
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 10
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-23