You're looking at our questions archive. This question was last updated over 1 year ago.
If you're looking for help, head over to the Parse Developers Google Group or check out the parse.com tag on Stack Overflow.Help Google Group Stack Overflow
15 votes 1 answer 24.1k views over 1 year ago
Deleting an object will not delete any file that is referenced by any of its columns.
Files are static assets and may be referenced from different places. For example, your app may have cached an object with a reference to this file. Even if the original object has been deleted from the server, cached data should continue working without impacting the user experience in most cases.
If you still want to delete a file, you can do so through the REST API. You will need to provide the master key in order to be allowed to delete a file. Note that the name of the file must be the name in the response of the upload operation, rather than the original filename.
curl -X DELETE \ -H "X-Parse-Application-Id: <YOUR_APPLICATION_ID>" \ -H "X-Parse-Master-Key: <YOUR_MASTER_KEY>" \ https://api.parse.com/1/files/<FILE_NAME>
You may have files which are not referenced by any object in your app, in which case it is not possible to delete them through the REST API. You may request a clean up of these unused files in your app's Settings page. Keep in mind that doing so might break any functionality which depended on accessing unreferenced files through their URL property. Files which are currently associated with an object will not be affected.
Since files do not have ACLs, their write access cannot be restricted to a specific user. Since leaving files open to deletion by any arbitrary user is not a great security measure, we require that a master key is used to delete a file. Since client SDKs cannot use the master key, you will need to use the REST API.