Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use database for upload session instead of Yii::$app->session #4

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Webkadabra
Copy link

This improves behavior when one user is uploading in multiple windows, and fixes #3

Webkadabra and others added 12 commits November 5, 2018 00:17
Example:

```
$file = UploadFromUrl::getInstance($model,'logo_url'); // `logo_url` must be a full URL to a remote image
$model->createRemoteFile('logo', $file, '/uploads/logo.jpg');
```
Add `onSuccess` option - a callable function to be returned after successful upload instead of responce. Function signature is ```function (File $file, ActiveRecord $model){}```, where `File` is the model that's configured in `createFile` option of model's file behavior configuration
@Webkadabra
Copy link
Author

@rkit do you want me to help?

Webkadabra and others added 14 commits May 8, 2019 01:39
…erent versions of a model to a single API endpoint

```
class OldCar extends Car
{
    public function init() {
        parent::init();
        $this->car_type = 'old;
        FileBehavior::addClassAlias(get_class($this), Car::className());
    }
    public function formName() {
        return 'Car';
    }
}
```
This reverts commit be261ec.
…s linked during `createFile`) to avoid duplicate links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple files do not save
1 participant