Files
ambz-sdk/lib/amb1_sdk/common/example/s3_upload/User Guide.txt
2024-12-15 00:34:01 +06:00

27 lines
2.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This user guide helps you to setup download server and session token
In this version of the example code, a local download server is used to demonstrate how to upload a large file by multiple parts to the AWS S3 server. Also, session token option is added for testing purpose.
To run the demonstration, you need to setup local download server.
To test the session token, you need to control the related macros to add the x-amz-security-token in different positions and test all the possible combinations
Setup download server (use PC as local download server)
1) Make sure PC and Ameba-1 are in the same network (eg. connect to the same wifi)
2) Place test file in the download server by adding the test file under tools\DownloadServer(HTTP)
3) Open “tools\DownloadServer(HTTP)\start.bat” in notepad
4) Change file path with the name of the test file (eg. image.jpg)
5) Run “tools\DownloadServer(HTTP)\start.bat” and wait for download request
6) In cmd, enter ipconfig to see the PCs (download server) IP address (IPv4 Address)
7) Open example_s3_upload.c
8) Set DL_File_TYPE to the format of test file
9) Set DL_SERVER_HOST to the PCs IP address
10) Set DL_RESOURCE to the name of test file
11) Set S3_RESOURCE to the name to be shown in S3 server
12) Compile and run example_s3_upload.c
13) Connect Ameba-1 to the same network as download server connected
Setup SESSION_TOKEN (temporary security credentials)
1) When use session token as the credentials, set SESSION_TOKEN as 1 in example_s3_upload.c
2) Fill in S3_KEY_ID, S3_KEY_SECRET and S3_SESSION_TOKEN to the temporary security credentials that obtained from AWS STS
3) Edit ADD_IN_FORM_FIELD, ADD_IN_POLICY and ADD_IN_REQUEST_HEADER to control where to add the x-amz-security-token to.
4) Edit the rest of S3 server parameters (see component\common\example\s3_upload\readme.txt)
5) Compile and run example_s3_upload.c