PHPackages                             atk14/async-file-field - 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. atk14/async-file-field

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

atk14/async-file-field
======================

A set of features providing asynchronous file uploads in ATK14 applications

v1.0.6(3w ago)022.7k↓39.3%MITPHPPHP &gt;=5.4.0

Since Feb 7Pushed 3w ago2 watchersCompare

[ Source](https://github.com/atk14/AsyncFileField)[ Packagist](https://packagist.org/packages/atk14/async-file-field)[ Docs](https://github.com/atk14/AsyncFileField)[ RSS](/packages/atk14-async-file-field/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (6)Versions (8)Used By (0)

AsyncFileField
==============

[](#asyncfilefield)

A set of features providing asynchronous file uploads in ATK14 applications.

AsyncFileField is a great replace for built-in FileField.

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

[](#installation)

```
cd path/to/your/project/
composer require atk14/async-file-field

ln -s ../../../vendor/atk14/async-file-field/src/app/controllers/api/temporary_file_uploads_controller.php app/controllers/api/
ln -s ../../../vendor/atk14/async-file-field/src/app/forms/api/temporary_file_uploads app/forms/api/
ln -s ../../vendor/atk14/async-file-field/src/app/models/temporary_file_upload.php app/models/
ln -s ../../vendor/atk14/async-file-field/src/app/fields/async_file_field.php app/fields/
ln -s ../../vendor/atk14/async-file-field/src/app/widgets/async_file_input.php app/widgets/
ln -s ../../../vendor/atk14/async-file-field/src/public/scripts/utils/async_file_upload.v2.js public/scripts/utils/async_file_upload.js
ln -s ../../../vendor/atk14/async-file-field/src/public/styles/shared/_async_file_input.v2.scss public/styles/shared/_async_file_input.scss

```

Copy migration to a proper filename into your project and perform the migration script:

```
cp vendor/atk14/async-file-field/src/db/migrations/0019_temporary_file_uploads.sql db/migrations/
./scripts/migrate

```

Include async\_file\_upload.js to your gulpfile.

```
var applicationScripts = [
       // ...,
       "public/scripts/utils/async_file_upload.js",
       "public/scripts/application.js"
];

```

In public/scripts/application.js (or public/admin/scripts/application.js, ...), globally or for a specific action you can initialize the asynchronous file upload this way:

```
// globally
common: {
  init: function() {
    // ...
    UTILS.async_file_upload.init();
  }
}

// specific action
articles: {
  create_new: function() {
    UTILS.async_file_upload.init();
  }
}

```

Include styles for AsyncFileField in public/styles/application.scss (or public/admin/styles/application.scss, ...):

```
@import "shared/async_file_input";

```

Finally, in a form you can replace FileField with AsyncFileField.

```
