spiral / spiral/framework

[Storage] In case provided path is directory path at S3 there are error on getMimeType()

Open
#751 0 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Bug Component: Storage
Dominant language
PHP
Stars
2.1k
Forks
92
Avg merge
14h 57m
Merged PRs (30d)
4

Description

Description

We have webhook on upload any object in specific dir.
It works for uploaded(created) directory and we've detected that if you create directory this webhook send this key to our controller it can receive it as FileInterface but if you want to receive its mimetype it throws exception like:
Unable to retrieve the mime_type for file at location: some_dir/subdir

As I understand storage can work with directory as with files but it should be separated and user should be able to detect is it a file or directory.

How To Reproduce
$dirPath = 'some_dir/subdir';
$awsFile = $this->storage->file($dirPath);

$awsFile->getMimeType();
Additional Info
Q A
Framework Version 2.13.1
PHP version 8.1.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.