DirectAmazonUploader not working

Dec 12, 2008 at 9:23 PM
Hi Flajaxian

Just bought your DirectAmazonUploader component and referenced the dll files in my Visual Studio and made a very small and uncomplicated aspx test page (keys and bucket name changed, of course):

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test_flajaxian.aspx.vb" Inherits="festivall.test_flajaxian" %>
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.DirectAmazonUploader" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <fjx:FileUploader ID="FileUploader1" runat="server">
    <Adapters>
        <fjx:DirectAmazonUploader
            AccessKey="XXXXXXXXXXXXXXXXXXXX"
            SecretKey="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
            BucketName="bucketname" />
    </Adapters>
</fjx:FileUploader>
    </div>
    </form>
</body>
</html>

When I run the page the flash uploader shows up just fine, I can browse and select a file to upload - but when I click on the upload button the browser tells me that it's waiting for bucketname.s3.amazonaws.com and nothing more happens.

Technical info: running Visual Studio 2008 Standard, Firefox 3.0.4 and Flash 10.0 r12

The page has no code behind (or, actually I also tried to just put some dummy code in the code behind) as your example doesn't have either. Is that a problem.
Also: I'm running this test page from the local development server (Cassini), not a local or non-local IIS server. Should that be a problem?

 Best

Rasmus Wehner
Denmark


Coordinator
Dec 15, 2008 at 5:43 AM
I have just tested it with the same browser and flash player and cassini and it works for me. I have two questions:

1. What exactly is the error message you are getting?
2. Did you follow the step 4 here http://www.flajaxian.com/flajaxian.com/DirectAmazonUploader1.0Help.html#HowToUseDirectAmazonUploader ?
and Did you make the crossdomain file readable for public (accessible)?
Dec 16, 2008 at 12:42 PM
Hi Flajaxian

Thank you for your reply.
Yes, I followed the instructions to install the Flajaxian components:
  1. I referenced the dll files in the solution and I can see, that VS has made a copy of the two dll files in the 'bin' folder in the website.
  2. I uploaded a copy of your example crossdomain.xml file into the root of my bucket and made sure (and I have just checked again, just to be sure) that the crossdomain.xml was public-read in S3.
  3. I then made an aspx page with the markup as cites in the starting article of this thread/discussion, more or less copying your example.
When I run the page the flash file browser and buttons (your Flajaxian GUI, so to speak) shows up just fine and I can browse and select file(s). But when I click the upload button I just get a message in the browsers status bar that it is waiting for [bucketname].s3.amazonaws.com and then after a while it states in the browser status bar that it's done. But the file doesn't get uploaded.

When I check the markup/HTML of the page in Visual Studio I can see, that VS gives me some warnings (green squiggles) under some of the Flajaxian markup. Specifically:

1) For <fjx:FileUploader ... > I get the following warning: Content is not allowed between the opening and closing tags for element 'Fileuploader'.
2) For <adapters> I get the following warning:: Validation (XHTML 1.0 Transitional): Element 'adapters' is not supported.
3) For <fjx:DirectAmazonUploader ...> I get the following warning: Element 'DirectAmazonUploader' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.

Ad 3): The site compiles just fine and there is a working web.config file in the solution.

Does the above give you any clues to what might cause my problems with the Flajaxian DirectAmazonUploader component?

Best

Rasmus Wehner
Coordinator
Dec 16, 2008 at 3:21 PM
The warnings you mention are from the FileUploader not Amazon Uploader and they are only related to the VS design view and have no influance on  the work of the control. We plan to develop that VS design view functionality but it is not yet there.

Your problem sounds to me like wrong Access Key or Secret Key. But to be sure I would recommend you install Fiddler2 http://www.fiddler2.com/Fiddler2/version.asp then try the upload and see on Inspectors tab lower right side (this is response) what is the message.

I will update Amazon Uploader later this week to return the error message issued by Amazon to the user.
Dec 16, 2008 at 10:28 PM
Hi Flajaxian

Well, I've done a bit of research (using Fiddler and Firebug and others) and it turns out that it seems to be more of a Firefox/Flash problem on my computer than a general Flajaxian problem.
If I run my page containing a Flajaxian DirectAmazonUploader instance in IE (7) everything works fine: I get the UI and I can upload to S3.
Same thing if I use Google Chrome.

But: if I use Firefox on my development computer nothing happens. The file gets highlighted in yellow in the list of files to be uploaded, but nothing gets uploaded and the progress bar doesn't move.
Using Firebug I can see that no http connections are being made from Firefox/Flash to S3, so something is definitely going wrong 'inside' Firefox/Flash.

But it seems like a local problem with my development computer, because if I upload the aspx page to a server and try running the page on my development machine I get the same 'error'. If I run the page in another machine with exactly the same setup (Firefox 3.0.4, Flash 10.0r12) everything works fine. Very strange.
I'm wondering if it is some of the development plugins I have in Firefox on my development machine (Firebug, Web Developer Toolbar, Foxmarks, Yslow etc.) that are blocking for the http traffic inside Firefox.

Well, it seems like my problem isn't a general one and therefore this thread/discussion shouldn't be of much interest to the public.
But thank you very much for trying to solve my problem.

Best
Rasmus Wehner
Coordinator
Dec 16, 2008 at 10:50 PM
Another thing you can do to debug is to see what's happening inside the flash. To do that set IsDebug property to true as:

<fjx:FileUploader ID="FileUploader1" IsDebug="true" runat="server">
   ...
</fjx:FileUploader>

Then put next to that page the ServerTracer.swf file - you can find it in the flash folder of the FileUploader project source

Load the ServerTracer.swf  in a different tab and at the same time on the first tab load the aspx page and try to upload. Do that for IE and Firefox then compare the differences. Let me know if you find something different.