Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throws UnableToCreateDirectory when only reading a file #1849

Open
mvoermans opened this issue Jan 31, 2025 · 0 comments
Open

Throws UnableToCreateDirectory when only reading a file #1849

mvoermans opened this issue Jan 31, 2025 · 0 comments

Comments

@mvoermans
Copy link

mvoermans commented Jan 31, 2025

Question

@frankdejonge

Hello, I'm using the ReadOnlyFilesystemAdapter to read a file. When open a file I get an 'UnableToCreateDirectory' exception.

The file I want to read is test.pdf. It's located in the //test/folder1 directory.

The function i use to get the file data:

public static function getFile($path, $fileName)
{
    try {

        $adapter = new LocalFilesystemAdapter($path);
        $fileSystem = new ReadOnlyFilesystemAdapter($adapter);

        return $fileSystem->read($fileName);
    } catch (FilesystemException | UnableToReadFile | UnableToCreateDirectory $exception) {
        return $exception;
    }
}

$file = getFile('//test/folder1/', 'test.pdf ')

It's installed on a Windows server and there is only a read authorization.

Q A
Flysystem Version 3.29.1
Adapter Name Read-only Adapter
Adapter version 3.28.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant