User Manual

Delete File From Bucket 

Delete File From Bucket 

Delete File From Bucket allows you to delete a file that was previously uploaded to a specific Bucket on the Kuika platform (e.g., using Upload File To Bucket). This action allows you to clean up unnecessary files on the client side or in the background, optimize storage costs, and simplify file management within the framework of security policies.

Supported providers are Amazon S3 and Google Cloud Storage, each managed through the Configuration Manager.

This action is available in both web and mobile applications. Depending on the provider, users may need to provide their own connection details (Access Key, Secret Key, Connection String).

Delete File From Bucket Action Steps

1. Action Definition

  • Open your project on the Kuika platform.
  • In the UI Design module, click the Add Action button on the right side and select the Delete File From Bucket action.

2. Specify Parameters

  • Object Key (String – required): The unique name of the file to be deleted within the bucket. Example: user_123/avatar.png
    • Can usually be assigned as Action Result, Current, Form Component, Screen Input, or Fixed.
  • Bucket Name (String – required): You can only select AWS or Google as the cloud provider.
  • Encrypt (Boolean – optional): If bucket encryption is used, this parameter can be used for verification during the deletion process.
    • true → Encryption check is performed.
    • false → Encryption check is not performed.

Running and Testing the Action

  • Run the action in Preview mode.
  • If successful, the specified Object Key is completely deleted from the Bucket.
  • If unsuccessful, the bucket name, key, or connection information should be checked via the error message.

Test Example: For AWS S3, you can verify whether the file has been deleted by running the command aws s3 ls s3://kuika-media-storage/user_123/ from the terminal.

Usage Scenario: Deleting User Avatar Files

In a social media application, when a user changes their profile picture, there is no need to keep the old picture in the bucket. In this case:

  • After the new picture is uploaded, the Delete File From Bucket action is triggered, deleting the old avatar.png.
  • This preserves storage space and prevents unnecessary files from remaining in the system.

Step-by-Step Usage

  1. File Check On the user profile update screen, the Object Key of the old avatar is first retrieved.
  2. Executing the Delete File From Bucket Action It is linked to the OnClick event.
    • Parameters:
      • Object Key: user_123/avatar.png
      • Bucket Name: You can only select AWS or Google as the cloud provider.
      • Encrypt: false
  3. Next Actions
    • If the file is successfully deleted: The new image is uploaded to the Bucket.
    • If deletion fails: A warning such as “File could not be deleted, please try again” is displayed to the user.

Delete File From Bucket Action Advanced Customizations

  • Dynamic Object Key: The file to be deleted can be dynamically determined based on user ID, date, or another parameter.
  • Multiple File Deletion: The action can be run sequentially multiple times to delete more than one file.
  • Conditional Deletion: The Object Key can only be deleted by users with a specific role. (Can be integrated with the Authorization panel.)
  • Integration with Expiration: Expired files can be automatically deleted based on expiration information stored in the cache or database.

Technical Risks

  • Incorrect Object Key Usage: If an incorrect or incomplete Object Key is entered, the file cannot be found.
  • Unauthorized Access: Bucket deletion operations should only be triggered by authorized users.
  • Encrypt Settings: Incorrect encryption parameters can cause the deletion operation to fail.
  • Connection Errors: Incorrect Connection String or Access Key can prevent access to the Bucket.
  • Provider Differences: Error messages may differ in AWS or GCP; therefore, provider-specific logging should be performed.

The Delete File From Bucket action allows you to securely, controllably, and dynamically delete files stored in buckets in Kuika applications. Thanks to dynamic parameter support, encryption control, and provider compatibility, it offers a flexible and secure file management mechanism.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar