Skip to content

Commit 901b87d

Browse files
deleting uploaded media section (#185)
<!-- If this pull request closes an issue, please mention the issue number below --> Closes #164 ## 💸 TL;DR <!-- What's the three sentence summary of purpose of the PR --> Added a “Deleting uploaded media” section to the Media Uploads docs. It clarifies that Devvit currently has no API to delete runtime assets uploaded with media.upload(), distinguishes those from static media.dir assets, and advises apps to remove stored references or update/delete posts/comments that embed the media.
1 parent 492e8c3 commit 901b87d

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

docs/capabilities/server/media-uploads.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ await reddit.submitComment({
165165
});
166166
```
167167

168+
## Deleting uploaded media
169+
170+
Devvit does not currently provide an API to delete a media asset after it has been uploaded with `media.upload()`.
171+
172+
This limitation applies to runtime Reddit-hosted uploads from `media.upload()`, not static assets bundled with your app through `media.dir` in `devvit.json`.
173+
174+
The `mediaId` and `mediaUrl` returned by `media.upload()` identify a Reddit-hosted asset, but the current media API only supports upload. If your app needs to stop showing uploaded media, remove your app's references to the asset and update or delete the Reddit content that embeds it.
175+
176+
For example:
177+
178+
- If you store uploaded media in Redis, delete the Redis key or remove the item from your app's list of visible assets.
179+
- If the media is embedded in a post or comment, edit or delete that post or comment when your app has permission to do so.
168180

169181
## Canvas screenshots
170182

versioned_docs/version-0.14/capabilities/server/media-uploads.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ await reddit.submitComment({
165165
});
166166
```
167167

168+
## Deleting uploaded media
169+
170+
Devvit does not currently provide an API to delete a media asset after it has been uploaded with `media.upload()`.
171+
172+
This limitation applies to runtime Reddit-hosted uploads from `media.upload()`, not static assets bundled with your app through `media.dir` in `devvit.json`.
173+
174+
The `mediaId` and `mediaUrl` returned by `media.upload()` identify a Reddit-hosted asset, but the current media API only supports upload. If your app needs to stop showing uploaded media, remove your app's references to the asset and update or delete the Reddit content that embeds it.
175+
176+
For example:
177+
178+
- If you store uploaded media in Redis, delete the Redis key or remove the item from your app's list of visible assets.
179+
- If the media is embedded in a post or comment, edit or delete that post or comment when your app has permission to do so.
168180

169181
## Canvas screenshots
170182

0 commit comments

Comments
 (0)