PHPackages                             ikodota/upload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. ikodota/upload

ActiveLibrary[File &amp; Storage](/categories/file-storage)

ikodota/upload
==============

上传 SDK for Laravel

v1.0.1(9y ago)9471MITPHP

Since Nov 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ikodota/flysystem-china)[ Packagist](https://packagist.org/packages/ikodota/upload)[ RSS](/packages/ikodota-upload/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

##### 说明

[](#说明)

本扩展为yangyifan/upload的分支，仅为解决在开发过这种遇到的问题：

- 原扩展没有release版本，导致开发时composer.json未设置"minimum-stability": "dev"时候，不能正常安装的问题，即便设置了 "minimum-stability": "dev"，直接使用composer update时会使其他依赖包也强制更新到了dev-master版本，带来不稳定因素。

##### 安装

[](#安装)

- composer require "ikodota/upload" 。
- 添加 UploadServiceProvider 到您项目 config/app.php 中的 providers 部分: Yangyifan\\Upload\\UploadServiceProvider。
- 支持七牛，upyun，oss。
- 完成按照官方 `Storage ` 来扩展。所以不需要修改代码，只需要新增配置文件信息，就可以替换任何一种存储引擎。

###### 开始

[](#开始)

- use Storage

```
use Storage;

```

- 示例代码

```

        $image  = "11/22/33/7125_yangxiansen.jpg";
        $image2 = "111.png";
        $image3 = "2.txt";

        $drive = \Storage::drive('oss');                                                            //选择oss上传引擎

        dump($drive->getMetadata($image2));                                                         //判断文件是否存在
        dump($drive->has($image2));                                                                 //判断文件是否存在
        dump($drive->listContents(''));                                                             //列出文件列表
        dump($drive->getSize($image2));                                                             //获得图片大小
        dump($drive->getMimetype($image2));                                                         //获得图片mime类型
        dump($drive->getTimestamp($image2));                                                        //获得图片上传时间戳
        dump($drive->read($image3));                                                                //获得文件信息
        dump($drive->readStream($image3));                                                          //获得文件信息
        dump($drive->rename($image3, '4.txt/'));                                                    //重命名文件
        dump($drive->copy('4.txt/', '/txt/5.txt'));                                                 //复制文件
        dump($drive->delete('/txt/5.txt'));                                                         //删除文件
        dump ($drive->write("/txt/4.txt", $drive->read("/4.txt")) );                                //上传文件
        dump($drive->write("/test2.txt", "111222"));                                                //上传文件
        dump($drive->deleteDir('txt/'));                                                            //删除文件夹
        dump($drive->createDir('test3/'));                                                          //创建文件夹
        $handle = fopen('/tmp/email.png', 'r');
        dump ($drive->writeStream("/write/test3.png", $handle ) );                                  //上传文件(文件流方式)
        dump ($drive->writeStream("/test6.png", $drive->readStream('/write/test3.png') ) );         //上传文件(文件流方式)

```

###### 配置信息

[](#配置信息)

```

'qiniu' => [
            'driver'        => 'qiniu',
            'domain'        => '',//你的七牛域名
            'access_key'    => '',//AccessKey
            'secret_key'    => '',//SecretKey
            'bucket'        => '',//Bucket名字
            'transport'     => 'http',//如果支持https，请填写https，如果不支持请填写http
        ],

        'upyun' => [
            'driver'        => 'upyun',
            'domain'        => '',//你的upyun域名
            'username'      => '',//UserName
            'password'      => '',//Password
            'bucket'        => '',//Bucket名字
            'timeout'       => 130,//超时时间
            'endpoint'      => null,//线路
            'transport'     => 'http',//如果支持https，请填写https，如果不支持请填写http
        ],

		'oss'	=> [
			'driver'			=> 'oss',
			'accessKeyId'		=> '',
			'accessKeySecret' 	=> '',
			'endpoint'			=> '',
			'isCName'			=> false,
			'securityToken'		=> null,
            'bucket'            => '',
            'timeout'           => '5184000',
            'connectTimeout'    => '10',
			'transport'     	=> 'http',//如果支持https，请填写https，如果不支持请填写http
            'max_keys'          => 1000,//max-keys用于限定此次返回object的最大数，如果不设定，默认为100，max-keys取值不能大于1000
		],
	],

```

###### 其他

[](#其他)

- 如果需要支持其他的上传引擎，请联系我，如果我有空，我会去扩展，希望这个能帮助大家开发，谢谢，有问题pr我，或者邮件联系我，我的邮箱是：（原作者邮箱：）。
- 下一步计划将完成单元测试。

###### 协议

[](#协议)

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3448d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2890cf56a1bd569cff9ada707069add3f565be4231c0695ba21a445b175ba5f8?d=identicon)[ikodota](/maintainers/ikodota)

---

Top Contributors

[![tianxingxia-cn](https://avatars.githubusercontent.com/u/1150043?v=4)](https://github.com/tianxingxia-cn "tianxingxia-cn (1 commits)")

---

Tags

laravelsdkuploadqiniuossupyun

### Embed Badge

![Health badge](/badges/ikodota-upload/health.svg)

```
[![Health](https://phpackages.com/badges/ikodota-upload/health.svg)](https://phpackages.com/packages/ikodota-upload)
```

###  Alternatives

[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[zgldh/qiniu-laravel-storage

Qiniu Resource (Cloud) Storage SDK for Laravel 5/6/7/8/9

530394.0k13](/packages/zgldh-qiniu-laravel-storage)[itbdw/laravel-storage-qiniu

A storage library for laravel5 and qiniu sdk

7015.2k](/packages/itbdw-laravel-storage-qiniu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
