List or delete old files (ParseFile)

#1

I want to clean old images from the my parse-server. I’m using the javascript clientside and sometimes nodejs on the server.

Now when I put a file “myImage.jpg” in a Class, it’s will return a url like: https://host.name/long-name/myImage.jpg

OK, it works… So now I want to remove that picture:

queryPicture.equalTo(“id”, item.id)
queryPicture.find().then((items) => {
items[0].unset(‘file’)
items[0].save()
})

It’s working, and in the dashboard the field is set to ‘undefined’

Great, but the old file is still available on the old URL…

The docs are pointing to a REST: DELETE command

But how can I cleanup? Now I have multiple files on the server, but I don’t know the URL.

1 Like
#2

It depends on where you are storing the files? Where are your files? AWS S3?