Folks,
I've got a hard question I've been wrestling with for a few days. I'm trying to get direct to Amazon S3 uploads running in a module. I've been able to get a proxy upload to work where I upload it to the web server, then on to S3, but that's inefficient and the user experience sucks with large files that take 20 minutes to complete.
Fortunately, Flajaxian has a handy solution here: http://www.flajaxian.com/ But at this point I'm trying to crawl before I run. The direct to S3 adapter works with the flajaxian file uploader you can find here: http://flajaxianfileupload.codeplex.com/
I built a one-page site on localhost and installed the control. With some fiddling, I got it to work as advertized. But then I tried it in DNN, and have been stuck ever since. The support at flajaxian is quick and responsive, but they don't know anything about DNN. There's something about DNN that is making this not work.
I made a module with just this control in it. I've installed the control here: http://simsbeta.com/Talks/TestUpload/tabid/127/Default.aspx. In the non-DNN site, I get the FileReceived event you see below. No joy in DNN. My source is as follows:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="testupload.ascx.cs" Inherits="DotNetNuke.Modules.DharmaTalks.testupload" %>
<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>
Choose MP3 file to upload:
<br />
<fjx:FileUploader ID="FileUploader1" runat="server" OnFileReceived="FileUploader1_FileReceived">
<Adapters>
<fjx:FileSaverAdapter Runat="server" FolderName="UploadFolder" />
</Adapters>
</fjx:FileUploader>
With code behind:
using System;
namespace DotNetNuke.Modules.DharmaTalks
{
public partial class testupload : DotNetNuke.Entities.Modules.PortalModuleBase
{
protected void FileUploader1_FileReceived(object sender, com.flajaxian.FileReceivedEventArgs e)
{
throw new NotImplementedException();
}
}
}
The control adds a bunch of JS to the page, and I'm guessing the problem might be in there.
<div id="dnn_ctr741_ModuleContent" class="SIMS TalksContent">
Choose MP3 file to upload:
<br />
<div id="dnn_ctr741_testupload_FileUploader1">
<a href="http://get.adobe.com/flashplayer/" target="_blank">Please install Adobe Flash Player</a>
</div>
<script type="text/javascript" language="javascript">
window.dnn_ctr741_testupload_FileUploader1 = new Flajaxian.FileUploader2('dnn_ctr741_testupload_FileUploader1');
function dnn_ctr741_testupload_FileUploader1_MarkInitialized(){ window.dnn_ctr741_testupload_FileUploader1.markInitialized(); }
function dnn_ctr741_testupload_FileUploader1_SetFileList(list){ window.dnn_ctr741_testupload_FileUploader1.setFileList(list); }
function dnn_ctr741_testupload_FileUploader1_SetUploadProgress(evt){ window.dnn_ctr741_testupload_FileUploader1.setUploadProgress(evt); }
function dnn_ctr741_testupload_FileUploader1_SetChangedFileStates(list){ window.dnn_ctr741_testupload_FileUploader1.setChangedFileStates(list); }
function dnn_ctr741_testupload_FileUploader1_LimitReached(type){ window.dnn_ctr741_testupload_FileUploader1.limitReached(type); }
function dnn_ctr741_testupload_FileUploader1_ConfirmUpload(){ window.dnn_ctr741_testupload_FileUploader1.confirmUpload(); }
function dnn_ctr741_testupload_FileUploader1_Dispose(){ window.dnn_ctr741_testupload_FileUploader1.dispose(); }
function dnn_ctr741_testupload_FileUploader1_EmbedFlash(){
var p = {menu:false,base:'.',scale:'noscale',bgcolor:'#FFFFFF'};
var a = {};
var fv = {id:"dnn_ctr741_testupload_FileUploader1",targetUrl:"http://simsbeta.com/Default.aspx?__ID=dnn_ctr741_testupload_FileUploader1_(!AMP!)_",debug:false,enabled:true,isIE:Flajaxian.isIE(),clearListAtEnd:true,uploadRequiresJsConfirmation:false,initiallyInvisible:false,maxFileSize:1072668082176,maxFileQueueSize:1072668082176,maxFileNumberLimit:2147483647};
swfobject.embedSWF("/WebResource.axd?d=IsqpByigtk34zp3y-m4U50vFCQAV_cx1ES9QquVFKKGoEMUJmmRBiLmGHCpb9GqAMQZ585qMlb7mN9V4Eil0mQgsMWYBUcWt0&t=633777437526668880", "dnn_ctr741_testupload_FileUploader1", "251", "40", "9.0.0", "/WebResource.axd?d=IsqpByigtk34zp3y-m4U50vFCQAV_cx1ES9QquVFKKGoEMUJmmRBiLmGHCpb9GqAO0Lz1e7fdYzKosKVPcxNSaK94sDNpLai0&t=633777437526668880", fv, p, a);
var fu = window.dnn_ctr741_testupload_FileUploader1;
fu.set_generateBaseHtmlFunc(Flajaxian.generateBaseHtml);
fu.set_generateFileRowFunc(Flajaxian.generateFileRow);
fu.set_disposeFileRowFunc(Flajaxian.disposeFileRow);
fu.set_fileStateChangedFunc(Flajaxian.fileStateChanged);
fu.set_percentageChangedFunc(Flajaxian.percentageChangedFunc);
fu.set_maxFileNumberReachedFunc(Flajaxian.maxFileNumberReached);
fu.set_maxFileSizeReachedFunc(Flajaxian.maxFileSizeReached);
fu.set_maxQueueSizeReachedFunc(Flajaxian.maxQueueSizeReached);
fu.set_positionFilesListFunc(Flajaxian.positionFilesList);
fu.set_renderFilesListFunc(Flajaxian.renderFilesList);
fu.set_strings({maxFileNumberReached:'The maximum number of files allowed to be selected of \'2147483647\' has been reached.',maxFileSizeReached:'The maximum allowed file size of \'999GB\' has been exceeded.',maxQueueSizeReached:'The maximum allowed size of \'999GB\' for all the files in the queue has been exceeded.'});
fu.set_openedArrowUrl("/WebResource.axd?d=IsqpByigtk34zp3y-m4U50vFCQAV_cx1ES9QquVFKKGoEMUJmmRBiLd1vbotsffcvXhPWpS2EsbMH49Bgj9L1qkqSkuURbJb0&t=633777437526668880");
fu.set_closedArrowUrl("/WebResource.axd?d=IsqpByigtk34zp3y-m4U50vFCQAV_cx1ES9QquVFKKGoEMUJmmRBiLd1vbotsffcy0zWaVW3ZxtZyxxhNe78XlSrIOZf4GyZ0&t=633777437526668880");
fu.set_closeBtnUrl("/WebResource.axd?d=IsqpByigtk34zp3y-m4U50vFCQAV_cx1ES9QquVFKKGoEMUJmmRBiLd1vbotsffcWd-Q7rskykkjxoMbwOwY6csI8O_iol0y0&t=633777437526668880");
fu.set_flashWidth(251);
fu.set_flashHeight(40);
fu.set_uploadRequiresJsConfirmation(false);
fu.set_clearListAtEnd(true);
fu.initialize();
}
dnn_ctr741_testupload_FileUploader1_EmbedFlash();
</script>
</div>
I know it's a long shot, but does anyone see anything weird in here this control is trying to do that DNN won't like?
As always, thanks for your help.