Why don't Parse.File have delete method?

If I want to delete file, I need to make a DELETE request to parse server. But this is extra work. Why cant we delete file like we delete parse objects.

Something like this would be great:
await parseFile.delete({useMasterKey:true});

This would be much easier. Can you tell me why this is not the way to go. What are the vulnerabilities?

You can delete files using:

await file.destroy({ useMasterKey: true });

SDK Reference

1 Like

Thats great I looked in JS docs but didnt see that. Thank you. Docs needs to be updated or maybe they intensionally didnt add because its node specific? Anyway thank you again.

It’s a good suggestion. There a number of documentation issues which are up for grabs, this subject being one of them. Naturally as Parse Server continues to evolve, updating documentation requires a lot of time, time that often is spent on building new features :slight_smile: .

I’ve submitted a PR that will update the docs to include information around deleting files via JS.

1 Like