Skip to content

Commit 208046b

Browse files
committed
update docs for temporary file deletion
1 parent 000b574 commit 208046b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

7.x-dev/crud-uploaders.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ class SomeModel extends Model
330330
}
331331
```
332332

333+
<a name="deleting-temporary-files"></a>
334+
## Deleting temporary files
335+
336+
When using ajax uploaders, the files are uploaded to a temporary disk and path before being moved to the final disk and path. If by some reason the user does not finish the operation, those files may lay around in your server temporary folder.
337+
To delete them, we have created a `backpack:purge-temporary-folder` command that you can schedule to run every day, or in the time frame that better suits your needs.
338+
339+
```php
340+
// in your routes/console
341+
use Illuminate\Console\Scheduling\Schedule;
342+
343+
Schedule::command('backpack:purge-temporary-folder')->daily();
344+
345+
```
346+
347+
For additional configuration check the `config/backpack/operations/ajax-uploads.php` file. Those configurations can also be passed on a "per-command" basis, eg: `backpack:purge-temporary-folder --disk=public --path=temp --older-than=5`.
348+
333349
<a name="custom-upload-fields"></a>
334350
### Configuring uploaders in custom fields
335351

0 commit comments

Comments
 (0)