Giter Site home page Giter Site logo

aws-javascript-developer-guide-v2's Introduction

aws-javascript-developer-guide-v2's People

Contributors

brmur avatar chaficnajjar avatar daviddeyo avatar doug-aws avatar eanbyrne avatar hyandell avatar jjangga0214 avatar joshbean avatar jschwarzwalder avatar mantcz avatar mohitsriv avatar netgio avatar paul-b-aws avatar purefan avatar scalwas avatar seanfahey avatar trivikr avatar wsierakowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-javascript-developer-guide-v2's Issues

JSON for CORS has an error (and photos don't list)

Two issues:

The JSON for CORS has an error.

Instead of

"AllowedMethods": [
"HEAD",
"GET",
}

You have to remove the second comma:

    "AllowedMethods": [
        "HEAD",
        "GET"

}

Also, I can't get my photos to list. They just say "There are no photos in this album"

Objects being created, not folders

Hi, this example feels pretty misleading. When you create and album you're just creating an empty object, not a folder. When you add an image to that folder it then creates the folder with that image in it. This means if you don't immediately add an image to the folder when created and reload the page, it isn't visible on the list folder screen, nor is there a folder in the s3 bucket.

By adding a forward slash to the end of the album name, it looks like it does create the folder. Is this a typo or just written on a previous version of the sdk?

Streaming Large CSV Downloads Using Expressjs

Hello,

I am storing large CSV files in a bucket (anywhere from 40k - 5M rows), and I am attempting to download them from my React app. I am using an Express API, but cannot seem to stream and initiate the download on the browser successfully. Any advice would be appreciated.

Below is a snippet of my code. I attempt to log the stream to get a view of it, but it always seems to freeze around 500 rows or so. Additionally, the download never seems to initiate on the browser - I am using Chrome, so I would imagine it would start the circle download bar once it begins receiving stream data.

s3.getObject({
                Bucket: 'example-bucket-csvs',
                Key: 'example_name.csv'
            })
            .on('httpData', (chunk => {
                console.log(chunk.toString());
                res.writeHead(200, {
                    'Content-Type': 'text/csv',
                    'Content-Disposition': 'attachment; example_name.csv'
                })
                chunk.pipe(res);
            }))

This documentation needs updating.

This document is extremely confusing, as it suggests it is essential to title Environmental Variables with "AWS" as a prefix, and yet this is specifically a reserved prefix when using Amazon Amplify.

It does not make sense to recommend a name that is specifically banned within Amazon's own ecosystem.

Help Wanted - Please Submit Examples for Your Common Scenarios!

Hey everyone! We're always on the lookout for good examples that illustrate "best practices" for performing common tasks using the AWS JavaScript SDK. We provide as many samples as we can when we first publish a guide, but only you know what you automate using the JavaScript SDK for on a daily basis. What common tasks have you automated with the AWS JavaScript SDK that others could learn from? Share your examples with us!

Submit a pull request as explained in these directions: https://github.com/awsdocs/aws-javascript-developer-guide-v2/blob/master/CONTRIBUTING.md

Thank you!
Dave Bishop

Missing credentials in config

While following the tutorial here, I got error "Missing credentials in config". As like below, the code is quite simple, but don't know why the error occurs even though I think I fully followed the prerequirements for the tutorial. I am curious to when the error message "Missing credentials in config" appears, so that I might guess the reason. Is this because AWS has changed or am I making something wrong?
It would be truly thankful if you let me know the right answer.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://sdk.amazonaws.com/js/aws-sdk-2.255.1.min.js"></script>
    <script>
        var bucketName = 'mama-swedenhouse-resources';
        var bucketRegion = 'ap-northeast-2';
        var identityPoolId = 'ap-northeast-2:f4250b2e-5d77-4413-bc3a-34c4xxxxxxxx'; //just hiding last 8 letters on this github issue 

        AWS.config.update({
            region: bucketRegion,
            credentials: new AWS.CognitoIdentityCredentials({
                identityPoolId: identityPoolId
            })
        });

        var s3 = new AWS.S3({
            apiVersion: '2006-03-01',
            params: {
                Bucket: bucketName
            }
        });

        function uploadPhoto() {

            var files = document.getElementById('test-file-input').files;
            if (!files.length) {
                return alert('Please choose a file to upload first.');
            }
            var file = files[0];
            var fileName = file.name;

            s3.upload({
                Key: fileName + ' ' + Math.floor(Date.now()),
                Body: file,
                ACL: 'public-read'
            }, function (err, data) {
                if (err) {
                    console.log(err);
                    return console.log('There was an error uploading your photo: ', err.message);
                }
                console.log('Successfully uploaded photo.');
            });
        };
    </script>
</head>

<body>
<section>
    <input type="file" name="test-file-input" id="test-file-input" accept="image/*">
    <button id="uplaod-btn" onclick="uploadPhoto();">업로드</button>
</section>
</body>

</html>
Error message
Error: Missing credentials in config
    at constructor.fail (aws-sdk-2.255.1.min.js:50)
    at constructor.validateStructure (aws-sdk-2.255.1.min.js:50)
    at constructor.validateMember (aws-sdk-2.255.1.min.js:50)
    at constructor.validate (aws-sdk-2.255.1.min.js:50)
    at constructor.<anonymous> (aws-sdk-2.255.1.min.js:49)
    at constructor.callListeners (aws-sdk-2.255.1.min.js:51)
    at constructor.emit (aws-sdk-2.255.1.min.js:51)
    at constructor.emitEvent (aws-sdk-2.255.1.min.js:50)
    at constructor.e (aws-sdk-2.255.1.min.js:50)
    at a.runTo (aws-sdk-2.255.1.min.js:52)
aws-s3-upload.html:48 There was an error uploading your photo:  Missing credentials in config

bucketRegion should be identityPoolRegion

I discovered that the variable "bucketRegion" would be more accurate if it were renamed to "identityPoolRegion". I discovered this because my bucket is in us-west-2 but my identity pool id has a region of us-east-1 and the only region that was accepted was us-east-1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.