Trying to delete image in upload folder.
axios.delete(`${backendUrl}/uploads/files/${id}`})
The code above returns an error
DELETE http://localhost:1337/api/uploads/71 405 (Method Not Allowed)
Can anybody help to understand how to delete upload properly?
Related
Does anyone know the endpoint for getting all of the iamges you uploaded to the media libray in one request?
Im using next js with strapi and need a way to grab all of the images from the media library but there doesnt seem to be any documentation on this
/api/upload
GET /api/upload/files Get a list of files
GET /api/upload/files/:id Get a specific file
POST /api/upload Upload files
DELETE /api/upload/files/:id Delete a file
Reference
https://docs.strapi.io/developer-docs/latest/plugins/upload.html#configuration
GET /upload/files
You can read more on the docs
Reacreation
I should start by explaining what I've done to trigger this error:
1. Create a new Strapi App.
2. Create a Collection-Type with a Media Field.
3. Create a new Entry from this Collection-Type with a File uploaded.
4. Delete the Media Field from the Collection-Type.
5. Finally going to the Media Library (GET request to /upload/files) will result in an ERROR.
see steps here
FIX
I did find a fix to this situation, just Add the Media field back to the Collection-Type.
If you want to remove the Media field from the collection-type, remove it manually from its Entries first and then delete the Media field.
I can confirm your issue.
Can you please open a GitHub issue there - https://github.com/strapi/strapi/issues/new/choose
If you already have a fix, can you also submit a PR to fix it.
Thank you.
I have a strange behaviour from Laravel. I just copied the website to a new hoster. Everything is working quite fine but one thing: I can't access the images in my public folder. If I try to open an image on my own with "domain.com/img/Ausfahrten/42.png i get the following error:
error image loading
The folder structure on my server looks like this:
enter image description here
What method can't laravel find and how can I resolve this? I've already checked file permissions on the server, everything's fine there.
Laravel throw that error when it cannot find the file. Try to access to another directory without Uppercase letter in its path name.
once i clicked on "Proceed to checkout" button, we are getting below error
The sitename.com is't working
www.sitename.co.nz is currently unable to handle this request
Http Error 500
even in backend when we open some orders, than also same error in order-view page.
we have shared hosting.
It was a problem with magento core file cc.php file , one of our devoloper edited it in wrong way, once i replaced the
original file, it worked fine.
I made ajax image upload. How can I get image dimensions before file is uploaded? Or how can I stop uploading.
I wrote custom upload handler and have strange situation. If I'am trying to stop uploading file in "new_file" procedure by raising StopUpload(True) error - it works, but if I'am trying in receive_data_chunk procedure - it does not (actually django stops processing file, but server is still receiving data from client).
I use apache+mod_python.
Tnx.
Rather than rolling your own, I would use something like django-jquery-file-upload