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

useDisplayPaths is false, but return original filename #128

Open
deesouza-ps opened this issue Jun 21, 2024 · 4 comments
Open

useDisplayPaths is false, but return original filename #128

deesouza-ps opened this issue Jun 21, 2024 · 4 comments

Comments

@deesouza-ps
Copy link

deesouza-ps commented Jun 21, 2024

I have this code below.
Same the property useDisplayPaths with false, on upload return the original filename.

Storage::extend('google', function ($app, $config) {
	$client = new GoogleClient();
	$client->setClientId($config['clientId']);
	$client->setClientSecret($config['clientSecret']);
	$client->refreshToken($config['refreshToken']);

	$service = new GoogleServiceDrive($client);
	$adapter = new GoogleDriveAdapter($service, $config['folderId'], [
		'useDisplayPaths' => false,
	]);
	$driver = new Filesystem($adapter);

	return new FilesystemAdapter($driver, $adapter);
});

Upload

$fileNameUpload = $fileUpload->storeAs('ID_PATH_GOOGLE_DRIVE', $fileName, 'google');
@erikn69
Copy link
Contributor

erikn69 commented Jun 21, 2024

the main functionality is useDisplayPaths => true, but:
erikn69/laravel-google-drive-ext-demo/routes/web.php#L44-L48
ivanvermeyen/laravel-google-drive-demo/routes/web.php#L74-L84

Also feel free to open a PR

@angeljqv
Copy link

That is the laravel expected behaivor, this package works independently of Laravel

@deesouza-ps
Copy link
Author

When useDisplayPaths is true should return filename original.
But, when useDisplayPaths is false should return filename with the name that the Google give.

Sorry, but am'I wrong?

@angeljqv
Copy link

angeljqv commented Jun 26, 2024

Sorry, but am'I wrong?

Big yes, laravel handles only display paths, that means it return original filename, check laravel sources

this package works independently of Laravel

and useDisplayPaths = false is only for emulate old https://github.com/nao-pon/flysystem-google-drive package

If you feel it should work the way you want feel free to open a PR with your changes.

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

3 participants