parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

REST Delete file error

Open umusset opened this issue 10 years ago • 5 comments

Hello,

Environment Setup

Parse server 2.2.6 mLAB

Steps to reproduce

Try to delete a file with cURL

curl -X DELETE
-H "X-Parse-Application-Id: myapp"
-H "X-Parse-Master-Key: mymaster"
http://myAPP.herokuapp.com/parse/files/myAPP/bb92af56a083d9247196eff493d9a3cd_picture.jpg

Then i got an error : 404 Not Found , Cannot DELETE /parse/files/myAPP/bb92af56a083d9247196eff493d9a3cd_picture.jpg

Thanks !

umusset avatar Apr 07 '16 18:04 umusset

remove the myAPP and it should work.

flovilmart avatar Apr 07 '16 19:04 flovilmart

It works ! Thanks :)

umusset avatar Apr 07 '16 19:04 umusset

We could add that endpoint as well but the appId is not really useful in that case as you pass it part of the headers

flovilmart avatar Apr 07 '16 19:04 flovilmart

Is it still possible to delte files this way? I'm running a local Parse Server. I'm receiving Cannot DELETE /MyAppName/files/GsVo6TefWYw2iMRq4jj33xIU7hoGc5LuxiK60sm8/5ad7de3d4e4decaa108a3024fae82f7c_hqdefault.jpg

My request:

curl -X DELETE \
  http://localhost:1337/MyAppName/files/GsVo6TefWYw2iMRq4jj33xIU7hoGc5LuxiK60sm8/5ad7de3d4e4decaa108a3024fae82f7c_hqdefault.jpg \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: ac16b301-c924-4a7c-8594-0f40d1ea764e' \
  -H 'X-Parse-Application-Id: GsVo6TefWYw2iMRq4jj33xIU7hoGc5LuxiK60sm8' \
  -H 'X-Parse-Master-Key: ****************' \
  -H 'cache-control: no-cache'

RaschidJFR avatar Feb 12 '19 20:02 RaschidJFR

Never mind... I just changed the url to http://localhost:1337/MyAppName/files/5ad7de3d4e4decaa108a3024fae82f7c_hqdefault.jpg and it worked.

RaschidJFR avatar Feb 12 '19 20:02 RaschidJFR