How to store to Database after it stores to S3

Sep 11, 2008 at 11:28 PM
I would like to know if its possible to store to the database once the s3 is succesfully stored. Please help w/any example code
Sep 11, 2008 at 11:58 PM
on the same note, i would like to get the response ETag ID of the image back from s3 to store into database. i would be only storing the URL, ID, and filename for reference purpose.
Coordinator
Sep 12, 2008 at 12:17 AM
Edited Sep 12, 2008 at 12:18 AM
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>
<%@ Register TagPrefix="fjxau" Namespace="com.flajaxian.AWS" Assembly="com.flajaxian.AmazonUploader" %>
<%@ Import namespace="System.Net" %>
<%@ Import namespace="com.flajaxian.AWS" %>
<script language="C#" runat="server">
private void ResponseReceived(object sender, ResponseReceivedEventArgs arg){

  // do your work here: save to db or anything you need.
  // you can use th following feelds
  HttpWebResponse hwr = arg.Response;
  string s = arg.Status;
  bool ok = arg.IsSuccessful;
  
}
</script>

...

<fjx:FileUploader ID="FileUploader1" runat="server" >
    <Adapters>
        <fjxau:AmazonUploader
                AccessKey="WebConfig:AmazonAccessKey"
                SecretKey="WebConfig:AmazonSecretKey"
                BucketName="media.flajaxian.com" 
                OnResponseReceived="ResponseReceived">
                    <AccessControlList>
                        <fjxau:AccessControl URI="http://acs.amazonaws.com/groups/global/AllUsers" Permission="READ" />
                        <fjxau:AccessControl EmailAddress="john@flajaxian.com" Permission="FULL_CONTROL" />
                    </AccessControlList>
            </fjxau:AmazonUploader>
    </Adapters>
</fjx:FileUploader>
Coordinator
Sep 12, 2008 at 12:19 AM
In this example you can use ResponseReceived event. Note OnResponseReceived="ResponseReceived"

Sep 12, 2008 at 12:31 AM
Thanks much, this is a great tool!