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

Fix error on delete method #53

Merged
merged 4 commits into from
May 21, 2022
Merged

Fix error on delete method #53

merged 4 commits into from
May 21, 2022

Conversation

ryanito
Copy link
Contributor

@ryanito ryanito commented Jul 8, 2021

This PR fixes the delete method of the controller to correctly delete the folder for the uploaded file (closes #41). As mentioned in #42 it uses Laravel's Storage feature instead of local disk.

public function delete(Request $request)
    {
        $absolutePathToFile = $this->filepond->getPathFromServerId($request->getContent());
        $storagePathToFile = strstr($absolutePathToFile, config('filepond.temporary_files_path', 'storage/app'));
        $storagePathToFolder = dirname($storagePathToFile);
        if (Storage::disk(config('filepond.temporary_files_disk', 'local'))->deleteDirectory($storagePathToFolder)) {
            return Response::make('', 200, [
                'Content-Type' => 'text/plain',
            ]);
        }

        return Response::make('', 500, [
            'Content-Type' => 'text/plain',
        ]);
    }```

@Pezhvak
Copy link

Pezhvak commented Oct 25, 2021

@Sopamo would you please merge this?

@patimio66
Copy link

@Sopamo please merge this pr.

@Sopamo
Copy link
Owner

Sopamo commented Mar 31, 2022

@ryanito thanks for your contribution! Could you please update your PR to work with the latest V1 release?

@ryanito
Copy link
Contributor Author

ryanito commented Apr 4, 2022

@ryanito thanks for your contribution! Could you please update your PR to work with the latest V1 release?

All done!

@Sopamo Sopamo merged commit f1d821f into Sopamo:master May 21, 2022
@Sopamo
Copy link
Owner

Sopamo commented May 21, 2022

Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

Got 500 error on delete method
5 participants