PHPackages                             igogo5yo/yii2-upload-from-url - 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. [Framework](/categories/framework)
4. /
5. igogo5yo/yii2-upload-from-url

ActiveYii2-extension[Framework](/categories/framework)

igogo5yo/yii2-upload-from-url
=============================

UploadFromUrl extension for Yii Framework 2

v1.4(8y ago)776.2k↓25%6MITPHP

Since May 29Pushed 8y ago4 watchersCompare

[ Source](https://github.com/igogo5yo/yii2-upload-from-url)[ Packagist](https://packagist.org/packages/igogo5yo/yii2-upload-from-url)[ RSS](/packages/igogo5yo-yii2-upload-from-url/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

UploadFromUrl extension for Yii 2
=================================

[](#uploadfromurl-extension-for-yii-2)

[![Build Status](https://camo.githubusercontent.com/92ba6fae7929bf056a03b8d5f8b97aceb49d8eb0f5f4ee6cb21dd8cce656d26f/68747470733a2f2f7472617669732d63692e6f72672f69676f676f35796f2f796969322d75706c6f61642d66726f6d2d75726c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/igogo5yo/yii2-upload-from-url)[![Latest Stable Version](https://camo.githubusercontent.com/16f46bf045a81d1cf1a7f83ee80339ece3c5efc7d59529bab91c42e93815b8b1/68747470733a2f2f706f7365722e707567782e6f72672f69676f676f35796f2f796969322d75706c6f61642d66726f6d2d75726c2f762f737461626c65)](https://packagist.org/packages/igogo5yo/yii2-upload-from-url)[![Total Downloads](https://camo.githubusercontent.com/d0b722487bf4ee7625f49ca14575de781ea137c2afd4912a54fb9a717d781ec5/68747470733a2f2f706f7365722e707567782e6f72672f69676f676f35796f2f796969322d75706c6f61642d66726f6d2d75726c2f646f776e6c6f616473)](https://packagist.org/packages/igogo5yo/yii2-upload-from-url)[![License](https://camo.githubusercontent.com/7b89ccc5ce76455e388be40901d4da9a8e94430f2971c688e99bbf3cb5b1efcd/68747470733a2f2f706f7365722e707567782e6f72672f69676f676f35796f2f796969322d75706c6f61642d66726f6d2d75726c2f6c6963656e7365)](https://packagist.org/packages/igogo5yo/yii2-upload-from-url)[![Dependency Status](https://camo.githubusercontent.com/77d21a2fff2157a0b944f84c5a9a2104195cc697903d91318a51efc960fcd6b5/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535363836656139363336353332303032363032313330302f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/55686ea96365320026021300)[![codecov.io](https://camo.githubusercontent.com/9f1bb289031a33f0ff31b1767125825b3da01f83ca6114f9a5e1cff3bf5fb715/68747470733a2f2f636f6465636f762e696f2f6769746875622f69676f676f35796f2f796969322d75706c6f61642d66726f6d2d75726c2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/igogo5yo/yii2-upload-from-url?branch=master)

This is the upload file from url address extension for Yii 2. It have class UploadFromUrl for upload files from URL and it have FileFromUlrValidator for validate model attribute with file from url.

Please submit issue reports and pull requests to the main repository. For license information check the [LICENSE](LICENSE.md)-file.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist igogo5yo/yii2-upload-from-url

```

or add

```
"igogo5yo/yii2-upload-from-url": ">=1.0"

```

to your `composer.json` file

Usage
-----

[](#usage)

**Example 1**

```
$model = new Post();
$model->load(Yii::$app->request->post());

$file = UploadFromUrl::getInstance($model, 'image');

//if second parameter is TRUE it writes uploaded file path to this model property
$file->saveAs('uploads/yii.png', true);

echo $model->image; // uploads/yii.png
```

**Example 2**

```
$model = new Post();
$model->image = 'http://static.yiiframework.com/files/logo/yii.png';

$file = UploadFromUrl::initWithModel($model, 'image');

//if second parameter is TRUE it writes uploaded file path to this model property
$file->saveAs('uploads/yii.png', true);

echo $model->image; // uploads/yii.png
```

**Example 3**

```
$url = 'http://static.yiiframework.com/files/logo/yii.png' ;
$path = 'uploads/yii.png';

$file = UploadFromUrl::initWithUrl($url);
$file->saveAs($path);

//Set to model
$model = new Post();
$model->image = $path;
```

**Example 4**

```
$url = 'http://static.yiiframework.com/files/logo/yii.png' ;
$path = 'uploads/yii.png';
$model = new Post();

$file = UploadFromUrl::initWithUrlAndModel($url, $model, 'image');
$file->saveAs($path, true);

echo $model->image; // uploads/yii.png
```

**Validation Example**

```
[
...
     [['image'], 'igogo5yo\uploadfromurl\FileFromUrlValidator', 'extensions' => 'csv', 'mimeTypes' => 'text/plain'],
...
]
```

Run Tests
---------

[](#run-tests)

```
phpunit --bootstrap tests/bootstrap.php tests
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 93.5% 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

Every ~240 days

Total

5

Last Release

3044d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74b24c6b7d845222ebf0141718d49ea5b15dbd20d9f42d56104a88a88dbe3520?d=identicon)[igogo5yo](/maintainers/igogo5yo)

---

Top Contributors

[![igogo5yo](https://avatars.githubusercontent.com/u/3601883?v=4)](https://github.com/igogo5yo "igogo5yo (43 commits)")[![bboure](https://avatars.githubusercontent.com/u/7089997?v=4)](https://github.com/bboure "bboure (2 commits)")[![RichWeber](https://avatars.githubusercontent.com/u/1702252?v=4)](https://github.com/RichWeber "RichWeber (1 commits)")

---

Tags

file-uploaduploadupload-from-urluploadfromurl-extensionyii2yii2-extensionyii2-upload-fileframeworkyii2igogo5youpload linkupload fileupload url

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/igogo5yo-yii2-upload-from-url/health.svg)

```
[![Health](https://phpackages.com/badges/igogo5yo-yii2-upload-from-url/health.svg)](https://phpackages.com/packages/igogo5yo-yii2-upload-from-url)
```

###  Alternatives

[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.6k47](/packages/skeeks-cms)[tecnocen/yii2-formgenerator

Yii 2 Library to configure form generator

145.7k](/packages/tecnocen-yii2-formgenerator)

PHPackages © 2026

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