upload file to s3 using javascript sdk

CSS
<script type="text/javascript">function s3upload() {   var files = document.getElementById('fileUpload').files;   if (files)    {     var file = files[0];     var fileName = file.name;     var filePath = 'my-first-bucket-path/' + fileName;     var fileUrl = 'https://' + bucketRegion + '.amazonaws.com/my-    first-bucket/' +  filePath;     s3.upload({        Key: filePath,        Body: file,        ACL: 'public-read'        }, function(err, data) {        if(err) {        reject('error');        }        alert('Successfully Uploaded!');        }).on('httpUploadProgress', function (progress) {        var uploaded = parseInt((progress.loaded * 100) / progress.total);        $("progress").attr('value', uploaded);      });   }};</script>
Source

Also in CSS: