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

Recent uploaded images are NOT deleted #675

Open
armancodes opened this issue Mar 21, 2020 · 6 comments
Open

Recent uploaded images are NOT deleted #675

armancodes opened this issue Mar 21, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@armancodes
Copy link
Contributor

I have noticed that whenever I upload a file and DELETE it in that post the recently uploaded image is not being deleted from storage/public directory:

image
This can make the application heavy in terms of the space that should be dedicated to it.

@austintoddj austintoddj self-assigned this Mar 22, 2020
@austintoddj austintoddj added the bug Something isn't working label Mar 22, 2020
@austintoddj
Copy link
Owner

That's a known issue. I'll see what I can do about getting it into a future release.

@armancodes
Copy link
Contributor Author

I have an idea about it.
You get the file names in the storage folder. Then you check your database.
In your database canvas_posts in the body column, you should see if that image name exists in any of those records.
As far as the query can be heavy enough to make the application slow it can be done through Laravel scheduler (once a day or whatever).

@armancodes
Copy link
Contributor Author

I'd be happy if you assign this task to me so that I'll be able to fix it.😊

@austintoddj
Copy link
Owner

I think the better route to go for this would be to handle this in the Vue components, specifically where we have methods that remove images. There, you could hit a single DELETE route with the filename, do a quick lookup in the MediaController, and return the proper response after the action is taken.

Let me know what you think, I'll assign this to both of us and I'll be more than happy to check out a PR once you've got one ready!

@Khanabeev
Copy link

Khanabeev commented Nov 30, 2020

Is this bug already fixed for a future release? Can I help to fix it?

@austintoddj
Copy link
Owner

Thanks @Khanabeev for offering that, SUPER helpful!

It's still an open bug, so if you'd like to take a stab at it and submit a PR, I'd be more than happy to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants