+ Start a Discussion
Bhawani SharmaBhawani Sharma 

Upload file to S3

Hi Experts,

I am trying to upload a file on S3. I have been verified everything couple of times and all looks correct to me, but whenever I am trying to upload file, getting error message saying

responseText =
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidArgument<BR/><Message>POST requires exactly one file upload per request.</Message><BR/><ArgumentValue>0</ArgumentValue><BR/><ArgumentName>file</ArgumentName><BR/><RequestId>3670E4EE52B3BCD5</RequestId><BR/><HostId>b3rOF/9WJHymo1ZENIOlrct/ZusAJ50AnSIP0df3K3+DdEcAFolJDx8qU6DH2N1l</HostId><BR/></Error></Code>

Can someone please help me to findout what I am doing wrong here?

        <div id="s3-fileuploader" class="dropArea"></div>
        <script type="text/javascript">

            j$ = jQuery.noConflict();

            //block and unblock UIbased on endpoint url
            function setUI(){

            $(document).ready(function () {
                    request: {
                        endpoint: "https://{!bucketname}.s3.amazonaws.com",
                        accessKey: "{!key}"
                    signature: {
                        //always included
                        "expiration": "{!expireStr}",
                        signature : "{!signedPolicy}",
                        policy: "{!policy}",

                            //always included
                            {"acl": "public-read"},
                            //always included
                            {"bucket": "{!bucketname}"},
                            //not included in IE9 and older or Android 2.3.x and older
                            {"Content-Type": "{!ContentType}"},
                            //always included
                            {"key": "{!key}"},
                            //always included
                            {"x-amz-meta-qqfilename": "{!URLENCODE('test.jpg')}"},
                    cors: {
                        expected: true, //all requests are expected to be cross-domain requests
                        sendCredentials: false, //if you want cookies to be sent along with the request
                        allowXdr: true

                    autoUpload: true,
                    debug: true,
                    text: {
                        uploadButton: '<i class="icon-plus icon-white">Select Files</i> '
                    uploadSuccess: {
                        endpoint: "{!redirectURL}"

                    //set endpoint


Marty C.Marty C.

Hello, Bhawani, your question seems to be about Amazon S3 and not about Salesforce. You may have better luck getting a useful answer by posting your question to the AWS Developer Forums[1].

[1]: AWS Developer Forums (https://forums.aws.amazon.com/index.jspa)

S3- Link is FREE App for Salesforce - Amazon Connector. Its also available on Appexchange. 

 1. Create Amazon S3 file for standard Salesforce attachment through
 2. Upload attachments on Amazon S3 and create reference in Salesforc to
    access those attachments
 3. Attach file related to any Salesforce object on Amazon.
 4. Unlimited free storage.
 5. Auto backup Event logs / inbound email attachments.
 6. Server Side Encryption: AES-256
 7. No file size limit for upload.
 8. File access control capabiliy.
 9. Track file downloads by users.
 10. File exlorer capability.


Here is our email address. Let us know if you have any query.