Ask AI
Skip to main content

Delete media

Function: Delete Media

This function allows you to permanently remove a media file from your application's media library. This is useful for cleaning up unused files, removing outdated content, or managing storage efficiently.

Input

  • Media ID (Text, Required): This is the unique identifier for the specific media file you wish to delete. You can typically find this ID when you upload or manage media within your application, or it might be stored alongside other data related to the media.

Output

No direct output is returned by this function. If the action completes successfully, the media file will be removed from your application's media library. If an error occurs (e.g., the Media ID is incorrect or the file cannot be found), an error message will be displayed within your application's logs or user interface.

Execution Flow

Real-Life Examples

  1. Deleting an Outdated Product Image:

    • Scenario: Your e-commerce store has an old product image for a "Vintage Leather Bag" that needs to be replaced with a new one. You want to remove the old image completely from your media library.
    • Inputs:
      • Media ID: prod_img_vintage_bag_old_12345
    • Result: The image associated with prod_img_vintage_bag_old_12345 is permanently removed from your application's media library, freeing up storage and ensuring only current images are available.
  2. Removing a Temporary Document:

    • Scenario: You uploaded a temporary "Draft Report Q3 2023" document for internal review. Now that the final report is published, you want to delete the draft to avoid confusion and free up space.
    • Inputs:
      • Media ID: doc_draft_report_q3_2023_abcde
    • Result: The "Draft Report Q3 2023" document identified by doc_draft_report_q3_2023_abcde is deleted from your application's storage, ensuring only relevant documents are kept.
  3. Cleaning Up User Profile Pictures:

    • Scenario: A user has updated their profile picture multiple times. To keep your media library tidy and only store the most recent version, you want to automatically delete their previous profile picture.
    • Inputs:
      • Media ID: user_profile_pic_john_doe_old_67890
    • Result: The old profile picture for John Doe, identified by user_profile_pic_john_doe_old_67890, is removed from the media library, maintaining a clean and current user profile.