Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Jun 15, 2024
1 parent fdd55d9 commit 6da339a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/vormkracht10/flysystem-uploadcare/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/vormkracht10/flysystem-uploadcare/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/vormkracht10/flysystem-uploadcare.svg?style=flat-square)](https://packagist.org/packages/vormkracht10/flysystem-uploadcare)

Flysystem adapter for Uploadcare with support for Laravel v10+.
Flysystem adapter for Uploadcare with support for Laravel v9+.

## Installation

Expand Down Expand Up @@ -48,26 +48,31 @@ $uuid = Storage::disk('uploadcare')->putFileAsGetUuid('files', new File('/var/ww
```

**Get the content of a file**

```php
$contents = Storage::disk('uploadcare')->get('<uuid>');
```

**Deleting a file:**

```php
Storage::disk('uploadcare')->delete('<uuid>');
```

**Getting the mimetype of a file**

```php
$mimeType = Storage::disk('uploadcare')->mimeType('<uuid>');
```

**Get the filesize of a file**

```php
$bytes = Storage::disk('uploadcare')->filesize('<uuid>');
```

**Get the original filename**

```php
$info = Storage::disk('uploadcare')->fileInfo($result[0]);
$filename = $info->extraMetadata()['originalFilename'];
Expand All @@ -77,6 +82,7 @@ $filename = $info->extraMetadata()['originalFilename'];

Directories in uploadcare are stored with an "~"-sign at the end of a uuid. Getting files from a directory could be retreived
as follow:

```php
$files = Storage::disk('uploadcare')->files('0123a456-a0bc-0a1b-0ab1-0a1234a5b6c7~');
foreach ($files as $uuid) {
Expand Down Expand Up @@ -107,9 +113,9 @@ Please review [our security policy](../../security/policy) on how to report secu

## Credits

- [Vormkracht10](https://github.com/vormkracht10)
- [Mathieu](https://github.com/casmo)
- [All Contributors](../../contributors)
- [Vormkracht10](https://github.com/vormkracht10)
- [Mathieu](https://github.com/casmo)
- [All Contributors](../../contributors)

## License

Expand Down

0 comments on commit 6da339a

Please sign in to comment.