Upload a raster image asset
- Topics:
- Dynamic Media Classic
CREATED FOR:
- Intermediate
- User
Before you can upload an image asset, you first request a shared-secret key. You use this shared-secret key to retrieve an upload token. You then use the upload token to upload raster image assets.
Request a shared-secret key
Request a shared-secret key by using the Admin Console to create a support case. In the technical support case, request a shared-secret key.
In the email message, provide the company name that you want to use to upload image assets. After you receive the key from Adobe Dynamic Media Classic, save it locally for future use.
Retrieve the upload token
The upload token ensures that no one can use the same shared-secret key to upload assets. It ensures that the upload is legitimate and comes from a trusted source.
The upload token is an alphanumeric string that is available only for a specific amount of time. Use the following URLs, substituting your shared-secret key, so you can retrieve the upload token.
- Raster image
https://s7ugc1.scene7.com/ugc/image?op=get_uploadtoken&shared_secret=fece4b21-87ee-47fc-9b99-2e29b78b602
In this example, the shared-secret key isfece4b21-87ee-47fc-9b99-2e29b78b602
By default, the upload token expires five minutes (300 seconds) after you retrieve it. To request more time, include expires
in the URL and the amount of time you require in seconds. For example, the following sample image URL retrieves an upload token that is valid for 1800 seconds:
https://s7ugc1.scene7.com/ugc/image?op=get_uploadtoken&shared_secret=fece4b21-87ee-47fc-9b99-2e29b78b602&expires=1800
The successful response for images appears similar to the following:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<scene7>
<user_generated_content>
<response>
<serviceName>User Generated Content: Images</serviceName>
<version>1.0.0</version>
<operationName>get_uploadtoken</operationName>
<serviceStatus>SUCCESS</serviceStatus>
<title>Upload Token for fece4b21-87ee-47fc-9b99-2e29b78b602</title>
<message>
<uploadtoken>aa2a378a-cd25-4c80-994d-312094e0ef20_1800</uploadtoken>
<expiration_in_seconds>1800</expiration_in_seconds>
</message>
</response>
</user_generated_content>
</scene7>
Save the upload token locally for use with future requests.
You can use the following fields in the query URL string to retrieve an upload token:
Sample raster image URL:
https://s7ugc1.scene7.com/ugc/image?op=get_uploadtoken&shared_secret=fece4b21-87ee-47fc-9b99-2e29b78b602&expires=600
Allowed HTTP methods:GET
and POST
You can now upload an image asset.
Upload a raster image asset
After you retrieve an upload token that is valid for a specific amount of time, you can upload an image asset. You upload the asset as a multipart/form post while sending the rest of the values as a URL query string, as shown in this example:
https://s7ugc1.scene7.com/ugc/image?op=upload&upload_token=aa2a378a-cd25-4c80-994d-312094e0ef20_18000&company_name=000Company
The upload_token
and company_name
fields are required.
See Retrieve the upload token.
See Retrieve a shared-secret key.
You can also send other optional values as URL query strings, as in this example:
https://s7ugc1.scene7.com/ugc/image?op=upload&upload_token=aa2a378a-cd25-4c80-994d-312094e0ef20_18000&company_name=000Company&file_limit=2000000&file_exts=jpg,gif
The file_limit
parameter specifies the file-size limit in bytes. The file_exts
parameter specifies the filename extensions that are allowed for upload. Both of these values are optional.
A global limit is set in the application for the file size limit and the filename extensions allowed. If what you sent in the request is a subset of the global limits, it is honored. The global limits are the following:
The following HTML form lets a user upload an asset. The form asks the user to enter the following information:
- A company name.
- An upload token.
- A file size limit.
- A list of filename extensions.
- Whether to preserve the color profile and file name associated with the asset.
- Whether to use a Knockout Background. If you enable Knockout Background, set the Corner, Tolerance, and Fill Method.
See Knockout Background in Image fine-tuning options at upload. - The name of the file to upload.
You can view the HTML source code associated with the form above by selecting https://s7ugc1.scene7.com/ugc/upload.html
In Firefox, right-click in the browser window, and then select View Page Source. The code shows the corresponding URL query string and the POST method that is run when the user selects Submit.
To view the XML response in Internet Explorer, go to View > Source. To view the XML response in Firefox, go to Tools > Browser Tools > Web Developer Tools. Firefox is recommended for viewing XML responses.
The following is a sample response from a successful upload:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<scene7>
<user_generated_content>
<response>
<serviceName>User Generated Content: Images</serviceName>
<version>1.0.0</version>
<operationName>upload</operationName>
<serviceStatus>SUCCESS</serviceStatus>
<title>Your file has been uploaded Successfully.</title>
<message>
<url>https://s7w2p1.scene7.com/is/image/ </url>
<path>000Company/ugc/1442564.tif</path>
<fullurl>https://s7w2p1.scene7.com/is/image/000Company/ugc/1442564.tif </fullurl>
</message>
</response>
</user_generated_content>
</scene7>
The asset is like any other ImageServing resource; you can apply processing queries to it. For example, the following URL requests an asset that is stretched to the specified width and its height.
https://s7w2p1.scene7.com/is/image/S7WebUGC/ugc/9536356.tif?&wid=800&hei=100&fit=stretch
Send the asset to upload as a multipart/form post while sending the rest of the values as a URL query string. You can use the following fields in the URL query string to upload an asset:
op
upload_token
company_name
file_limit
file_exts
preserve_colorprofile
preserve_filename
Sample URL:
https://s7ugc1.scene7.com/ugc/image?op=upload&upload_token=aa2a378a-cd25-4c80-994d-312094e0ef20_18000&company_name=000Company
Allowed HTTP method:
POST
Get asset metadata for images
You can use image_info
to retrieve metadata for an asset that you uploaded, as shown in the following example:
https://s7ugc1.scene7.com/ugc/image?op=image_info&shared_secret=fece4b21-87ee-47fc-9b99-2e29b78b602&image_name=1442564.tif
An example of a successful response appears similar to the following:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<scene7>
<user_generated_content>
<response>
<serviceName>User Generated Content: Images</serviceName>
<version>1.0.0</version>
<operationName>image_info</operationName>
<serviceStatus>SUCCESS</serviceStatus>
<title>More information on 1442564.tif</title>
<message>
File created on Tue Sep 08 19:02:04 CDT 2009, File Size = 243494 bytes
<imageFormat>Tiff</imageFormat>
<colorSpace>Rgb</colorSpace>
<width>686</width>
<height>457</height>
</message>
</response>
</user_generated_content>
</scene7>
You can use the following fields in the URL query string to request information for an asset:
op
shared_secret
image_name
Sample URL:
https://s7ugc1.scene7.com/ugc/image?op=image_info&shared_secret=fece4b21-87ee-47fc-9b99-2e29b78b602&image_name=1442564.tif
Allowed HTTP method:
GET and POST