🖼️ Gallery Events
yseries:server:gallery:on-photo-deleted
Triggered on the server when a gallery photo or video row is removed from the phone library.
Use this hook to delete the underlying media file from your upload provider (Fivemanage, S3, custom storage, etc.) after a player deletes media from the Gallery app.
This event is emitted with TriggerEvent and is not forwarded to clients. Listen with AddEventHandler in a server script in your own resource.
When it fires:
- A player deletes a photo or video (moved to Recently Deleted / recycle bin)
- A player deletes an album and chooses to delete the photos inside it
- The server permanently purges recycle-bin rows older than 30 days
Event Data:
lua
Usage Example:
lua
Notes:
- Prefer
AddEventHandleroverRegisterNetEvent. This event is server-only and should not be triggered from the client. - When
permanentisfalse, the row still exists in the database (recycle bin) and can be restored by the player. Deleting remote storage immediately may break restore. - When
permanentistrue, the database row has been permanently removed (recycle-bin purge). - For videos,
imageis the video file URL andthumbnailis the poster frame URL. Delete both if your provider stores them separately. - Upload configuration (Fivemanage, custom API) is documented in Camera / Upload.