• pavan kumar 14
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi All,

I am trying to upload a file in to AWS using AWS Javascript SDK in Visual force Pages. Below is the java script code i have used to upload the file :

function uploadFile() {
       document.getElementById('btnUpload').disabled=true;
        ddocument.getElementById('btnUpload').disabled=true;
        document.getElementById('dvMsg').style.visibility='visible';
     AWS.config.update({ accessKeyId: 'XXXXXXXXXXXXXXXXX', secretAccessKey: 'XXXXXXXXXXXXXXXXXXXXXXX' });
        AWS.config.update({region : 'regionName'});

     var aws_bucket = new AWS.S3({ params: { Bucket: 'bucketName' } });
     
     var fileChooser = document.getElementById('file');

     var file = fileChooser.files[0];

     var aws_err = ''; var timeStamp = '';var aws_data = '';
 
     if (file) {
       
         
         var aws_params = { Key: file.name, ContentType: file.type, Body: file };
         aws_bucket.putObject(aws_params, function (aws_err,aws_data) {
                //results.innerHTML = err ? 'ERROR!' : 'UPLOADED.';
             if(aws_err != null)
                {
                    results.innerHTML = ' Some Error Occured while processing your request, please try after some time.. ';
                    document.getElementById('dvMsg').innerHTML="";
                    }
                else
                    {
         
                document.getElementById('dvMsg').style.visibility='hidden';
                        document.getElementById('dvMsg').innerHTML="UPLOADED";
                        }
             
        });
     } else {
         results.innerHTML = 'Nothing to upload.';
     }
}


The above code worked perfect until 18th April 2014. From 21st April 2014, the same code is throwing error in IE ( but working in Firefox and Chrome) and not working at all.

And the Error is "Object doesn't support property or method 'indexOf' "

Also an update was happened in the salesforce on 18th April 11 PM PST,

Is this update causing an issue??

Please any one help us regarding the issue.
Hi All,

I am trying to upload a file in to AWS using AWS Javascript SDK in Visual force Pages. Below is the java script code i have used to upload the file :

function uploadFile() {
       document.getElementById('btnUpload').disabled=true;
        ddocument.getElementById('btnUpload').disabled=true;
        document.getElementById('dvMsg').style.visibility='visible';
     AWS.config.update({ accessKeyId: 'XXXXXXXXXXXXXXXXX', secretAccessKey: 'XXXXXXXXXXXXXXXXXXXXXXX' });
        AWS.config.update({region : 'regionName'});

     var aws_bucket = new AWS.S3({ params: { Bucket: 'bucketName' } });
     
     var fileChooser = document.getElementById('file');

     var file = fileChooser.files[0];

     var aws_err = ''; var timeStamp = '';var aws_data = '';
 
     if (file) {
       
         
         var aws_params = { Key: file.name, ContentType: file.type, Body: file };
         aws_bucket.putObject(aws_params, function (aws_err,aws_data) {
                //results.innerHTML = err ? 'ERROR!' : 'UPLOADED.';
             if(aws_err != null)
                {
                    results.innerHTML = ' Some Error Occured while processing your request, please try after some time.. ';
                    document.getElementById('dvMsg').innerHTML="";
                    }
                else
                    {
         
                document.getElementById('dvMsg').style.visibility='hidden';
                        document.getElementById('dvMsg').innerHTML="UPLOADED";
                        }
             
        });
     } else {
         results.innerHTML = 'Nothing to upload.';
     }
}


The above code worked perfect until 18th April 2014. From 21st April 2014, the same code is throwing error in IE ( but working in Firefox and Chrome) and not working at all.

And the Error is "Object doesn't support property or method 'indexOf' "

Also an update was happened in the salesforce on 18th April 11 PM PST,

Is this update causing an issue??

Please any one help us regarding the issue.
Hi All,

I am trying to upload a file in to AWS using AWS Javascript SDK in Visual force Pages. Below is the java script code i have used to upload the file :

function uploadFile() {
       document.getElementById('btnUpload').disabled=true;
        ddocument.getElementById('btnUpload').disabled=true;
        document.getElementById('dvMsg').style.visibility='visible';
     AWS.config.update({ accessKeyId: 'XXXXXXXXXXXXXXXXX', secretAccessKey: 'XXXXXXXXXXXXXXXXXXXXXXX' });
        AWS.config.update({region : 'regionName'});

     var aws_bucket = new AWS.S3({ params: { Bucket: 'bucketName' } });
     
     var fileChooser = document.getElementById('file');

     var file = fileChooser.files[0];

     var aws_err = ''; var timeStamp = '';var aws_data = '';
 
     if (file) {
       
         
         var aws_params = { Key: file.name, ContentType: file.type, Body: file };
         aws_bucket.putObject(aws_params, function (aws_err,aws_data) {
                //results.innerHTML = err ? 'ERROR!' : 'UPLOADED.';
             if(aws_err != null)
                {
                    results.innerHTML = ' Some Error Occured while processing your request, please try after some time.. ';
                    document.getElementById('dvMsg').innerHTML="";
                    }
                else
                    {
         
                document.getElementById('dvMsg').style.visibility='hidden';
                        document.getElementById('dvMsg').innerHTML="UPLOADED";
                        }
             
        });
     } else {
         results.innerHTML = 'Nothing to upload.';
     }
}


The above code worked perfect until 18th April 2014. From 21st April 2014, the same code is throwing error in IE ( but working in Firefox and Chrome) and not working at all.

And the Error is "Object doesn't support property or method 'indexOf' "

Also an update was happened in the salesforce on 18th April 11 PM PST,

Is this update causing an issue??

Please any one help us regarding the issue.