PHPackages                             royalcms/uploader - 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. royalcms/uploader

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

royalcms/uploader
=================

The Royalcms uploader package.

v5.0.2(5y ago)0641MITPHPPHP &gt;=5.5.9

Since Sep 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/royalcms/royalcms-uploader)[ Packagist](https://packagist.org/packages/royalcms/uploader)[ Docs](http://royalcms.cn)[ RSS](/packages/royalcms-uploader/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (4)Used By (1)

Royalcms Uploader
=================

[](#royalcms-uploader)

Uploading files and store its in Filesystem / Cloud storage in Royalcms is not easy and simple for some developers. This package provides a simple way to do that, and comes with fluent interface that you might like.

Configuration
-------------

[](#configuration)

The Uploader configuration is located at `packages/royalcms/uploader/uploader.php`, where you can adjust the default file provider and the default file visibility as you want.

File Providers
--------------

[](#file-providers)

This package comes with two file providers, from HTTP request and local filesystem. Before uploading a file, you can set where the file is provided. Example:

```
RC_Uploader::from('request')->upload('avatar'); // see the supported providers at config/uploader.php

// Or you can use the magic methods...
RC_Uploader::fromRequest()->upload('file');
RC_Uploader::fromLocal()->upload('/path/to/file');
```

If you call method on the `RC_Uploader` facade without first calling the `from` method, the uploader will assume that you want to use the default provider.

```
// If your default provider is local, it will automatically use the local provider.
RC_Uploader::upload('/path/to/file');
```

Usage
-----

[](#usage)

### Uploading a File

[](#uploading-a-file)

Now, uploading a file is very simple like this:

```
