Flajaxian S3 File Uploader Errors and Debugging

Jun 26, 2008 at 7:27 PM

I am useing the Flajaxian File Uploader to store files on S3 Amazon storage. I followed through the steps of the example but when I try to upload a file it fails. I am trying to figure out how to get a more detailed message than "filename.ext - failed." Or is there a way to debug and see where the process fails? Any input would be much appreciated.

Jun 27, 2008 at 5:42 PM

I downloaded the latest source and added the project to my solution so I could step through (com.flajaxian.AmasonUploader.csproj). The error I’m getting is “The remote server returned an error: (500) Internal Server Error” on line 84 of DimeManager.cs. I have tried different types of files (.jpg, .txt) same problem. I tried playing around with different permissions, in this example i gave FULL_CONTROL to all users.

Here is the xml that i am attempting to post:

<?xml version="1.0" encoding="utf-8" ?>

- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">

  <soap:Header />

- <soap:Body>

-  <PutObject xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

    <Bucket>amothertest.somedomain.com</Bucket>

    <Key>5865.jpg</Key>

    <ContentLength>7338</ContentLength>

-   <AccessControlList>

-     <Grant>

-       <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">

           <URI>http://acs.amazonaws.com/groups/global/AllUsers</URI>

         </Grantee>

         <Permission>FULL_CONTROL</Permission>

      </Grant>

    </AccessControlList>

    <AWSAccessKeyId>019JM0W54B36WGHVRX02</AWSAccessKeyId>

    <Timestamp>2008-06-27T11:35:28.904-05:00</Timestamp>

   <Signature>pWV//Ss7J586vWnZk16/pMkSLCw=</Signature>

   </PutObject>

  </soap:Body>

  </soap:Envelope>

 

Coordinator
Jul 2, 2008 at 5:02 AM
Something with your configurations is wrong. May be bucker amothertest.somedomain.com does not exist?
Jul 9, 2008 at 4:46 PM
I changed the bucket to one that already exists in my s3 account 019jm0w54b36wghvrx02-test-bucket got the same internal 500 error. Any other thoughts?
Coordinator
Jul 10, 2008 at 10:23 PM
Edited Jul 15, 2008 at 5:06 PM
A yes I see now - you cannot grant FULL CONTROL to everybody - Amazon won't allow that, or at least not just by requesting it. Grant READ control to everybody instead or create users for your customers.

If you allow full control to everybody that means that you allow anybody in the world to upload anything to your site. You want that?

This is a right request. I assign READ permission for everybody and Full control to john@smith.com

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
  <soap:Header>
  </soap:Header>
  <soap:Body>
    <PutObject xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
      <Bucket>media.somedomain.com</Bucket>
      <Key>test/test2/TheFileIUpload.doc</Key>
      <ContentLength>1231</ContentLength>
      <AccessControlList>
        <Grant>
          <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
            <URI>http://acs.amazonaws.com/groups/global/AllUsers</URI>
          </Grantee>
          <Permission>READ</Permission>
        </Grant>
        <Grant>
          <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail">
            <EmailAddress>john@smith.com</EmailAddress>
          </Grantee>
          <Permission>FULL_CONTROL</Permission>
        </Grant>
      </AccessControlList>
      <AWSAccessKeyId>321321321321</AWSAccessKeyId>
      <Timestamp>2008-07-10T14:15:49.483-07:00</Timestamp>
      <Signature>654654654654654</Signature>
    </PutObject>
  </soap:Body>
</soap:Envelope>