Uploading Image to Amazon s3 with HTML, javascript & jQuery with Ajax Request (No PHP)

前端 未结 5 1319
无人及你
无人及你 2020-11-28 00:48

I am developing a website in HTML, javascript & jQuery. I want to upload images to amazon s3 server in an ajax request. There is no such SDK to integrate s3 in Javascrip

5条回答
  •  萌比男神i
    2020-11-28 01:09

    For the authentication part,

    No php code, no server, no large JS code except below;

    you might use AWS Cognito IdentityPoolId as credential, less code but you are required to create AWS Cognito IdetityPool and attach policy, simply s3 write access.

         var IdentityPoolId = 'us-east-1:1...........';
    
    
         AWS.config.update({
            credentials: new AWS.CognitoIdentityCredentials({
                IdentityPoolId: IdentityPoolId
            })
         });
    
    

提交回复
热议问题