spatie / flysystem-dropbox

A flysystem driver for Dropbox that uses the v2 API
https://freek.dev/734-dropbox-will-turn-off-v1-of-their-api-soon-its-time-to-update-your-php-application
MIT License
342 stars 50 forks source link

The Dropbox API v2 does not support mimetypes #29

Closed incoming-th closed 6 years ago

incoming-th commented 6 years ago

Hi,

First, thanks for your work on this piece of software.

I am using it with Laravel 5.4 as provider for flysystem, included to elFinder.

Found a weird issue, not sure it is related to your script but maybe you found this before. I can see the folders, but then I cannot access folders with files:

2017-11-18 002318

Any idea? Thanks.

freekmurze commented 6 years ago

Can you provide a PHP code sample that results in this error?

robbytaylor commented 6 years ago

I just ran into this problem as well. The exception is thrown by any call to getMimetype() when using the Dropbox adaptor.

https://github.com/spatie/flysystem-dropbox/blob/master/src/DropboxAdapter.php#L232

I've worked around the issue for now by editing the Dropbox adaptor to calculate the mimetype from the filename, which is how the FTP Flysystem adaptor works:

https://github.com/thephpleague/flysystem/blob/master/src/Adapter/Ftp.php#L415

Would you accept a PR which adds the behaviour from the FTP driver to this package?

freekmurze commented 6 years ago

Yup! 👍

freekmurze commented 6 years ago

Fixed in #30

incoming-th commented 6 years ago

Just to confirm the fix is working fine, thank you very much!