download free 30 days trial version buy bucket explorer
Documentation  Download  Purchase  Support  FAQs   Forum   ScreenShots & Demos

Amazon S3 - Set Filename in Metadata

Amazon S3 allows you to set any type of information with S3 Object in the form of User Metadata. The Key of user metadata starts with x-amz-meta- as prefix. You can add File Name in the Metadata of an Amazon S3 Object (File), while uploading the File in S3 Bucket . You can upload Files on Amazon S3 by sending HTTP PUT Object Request to Amazon S3 Server. You can upload S3 Objects on Amazon S3 in two ways:
a) Using Amazon S3 API-   If you are a programmer, you can write your own program to use S3 REST API - PUT Object. You can read more on AWS website to learn details about using SOAP APIs.
b) Using Bucket Explorer User Interface- You can upload files on S3 with mouse clicks using Bucket Explorer, and also set Metadata there.
 

Set File Name in Metadata using S3 REST API

To add file name in Metadata, you need to send PUT Object request and passing x-amz-meta- prefix in the Request header for key and add the desired file name in value.

You can also use Content-Disposition metadata if you want to download the file instead of opening it in a browser. In this case, the Key will be Content-Disposition and the value will be attachment.
 
To authenticate the request, you must have WRITE permissions on the Bucket.

Syntax:


PUT / ObjectName HTTP/1.1
Host: BucketName .s3.amazonaws.com
Date: date
x-amz-meta-anykey: fileName
Authorization: signatureValue

How to set File Name in Metadata using Bucket Explorer?

Bucket Explorer supports to add file name in Metadata. To set file name in Metadata , just keep the keyword { $$file_name_without_path_$$ } in the value while specifying key-value pair. When you save the Metadata, the above keyword gets replaced with file name


Steps:

  1. Run Bucket Explorer and get authenticated with your saved credentials.
  2. Select a bucket from bucket table. It will list the objects of that bucket.
  3. Select any file of native system from left side tree/explorer view.
  4. Right click on selected file.
  5. Select “Upload with Custom Headers” option, displayed in context menu.
  6. It will show “Upload with custom header” dialog box.
  7. Enter any string for Key field and “{SSfile_name_without_path_$$}” for Value field of Metadata.
  8. Click OK.
  9. It will display Quick Comparer Panel. Select the Comparison Option and Action Type and click on Start button to start uploading.
  10. After uploading, select the newly uploaded file and see its properties .
  11. It will show property panel which lists all the Metadata attributes. You can see the Key that you have entered and the file name as Value in the list.