Flex App Basics 6: Multiple File Uploads
On Friday I added a "file management" area to the contact form in the app I'm working. Not long after, as I expected, a couple of you asked for the "killer feature" of being able to upload more than one file at a time.
Ask and thou shalt receive!
The vertical lists of files on the left is the "queue". Files shown there have been selected and are waiting to be uploaded.
Notice that, if you press the Select Files button, the file dialog that appears allow you to select more than one file at a time - unlike with the counterpart HTML file upload control.
Pressing the Upload button sends them, one-by-one, to the backend document. As each file is uploaded it gets removed from the queue and added to the list on the right.
Notice also, that the tiles for existing attachments on the right now include a "Save As" link. Whereas clicking the icon for the file lets the browser decide what to do, the Save As button lets you simply save it to your disk.
It needs a little more refinement, but I think it's ready for you guys to test it.
Replacement For ActiveX?
On Friday Curt Carlson said:
Now if you could choose to upload multiple files in one shot, that would be something Domino has refused to do without active x or some other non-native functionality.
This got me thinking. While this FileManager Flex component is a part of its containing Flex app, there's no reason it can't be used standalone in a normal HTML page.
Rather than needing to install/sign/embed a 3rd party ActiveX component and restrict your users to IE you could just add this component as a Flash SWF file and let it interact with your backend Domino document in the same way you can see it doing in the Flex demo.
If you're interested I'll create a SWF and demo?
Worked a treat for me - Fantastic. Great job Jake! The only thing I could see my users asking for is drag n drop functionality (they do ask for the world, don't they?) but I am sure this would be a browser limitation, not Flex...
What's next in this Flex adventure then Jake? I'm gripped and trying to keep up!
Reply
If I get time I'll look in to it, but expect d-n-d it's a no-goer.
Not sure what's next. Probably to polish off what exists (unless you can think of anything that's missing?) and possibly document how to go about converting your own Domino apps to use this "framework".
I've built the whole app you see here using configurable components (such as View.mxml and Form.mxml) so that it should be a simple task to Flexify a Notes database. Kind of like what Ext.nd tried to do with Ext, but better ;o)
Reply
Really good Jake.
An AIR app reusing your component would support drag and drop.
GMail actually uses Flash to do multiple file uploads as well - great minds think alike.
Reply
Hi Jake, Nice demo. Does this still work if you are not allowing anonymous users to upload (i.e. users need to be authenticated)?
I tried using SWFUpload to create a flash based multi-file upload control for Domino, but found an issue with the Flash player in that it does not maintain the active browser session in anything other than IE.
Does Flex suffer the same irritating problem?
Reply
Hi Cass,
Hmm. Just when I thought I was on to something.
You're right. It doesn't work well with anything other than Anonymous users. As I understand it the Flash plugin doesn't use the browser itself to send the file, so, in this case, it doesn't pass any authorisation headers with the request. If you login and then upload a file it considers you as Anonymous. DOHHHHH!
I'll have to look in to this and see if there's a way round it by passing in the auth headers to teh URL request, as discussed here:
http://stackoverflow.com/questions/509219/flex-3-how-to-support-http-authentication-urlrequest
Reply
What type of authentication were you using Cass? Sesion-based cookies or basic browser-based authentication? It seems only the latter has issues. If you use cookies then they get sent with the request and Domino knows who the user is.
Reply
Show the rest of this thread
You are the man Jake!
Reply
Please create a SWF demo if possible.
I've been dreaming of the day when I can dump that IE only DLI.Uploader ActiveX control from my sites.
I written ASP.NET websites that use SWFUpload, but I've never been able to get it to work in Domino.
Speaking of Flash, I never understood why IBM still uses (or gives you the option to use) Java applets for rich text fields and views. Flash would have been the best technology for these two things (if HTML/JavaScript didn't give you what was needed).
Reply
Wow Jake. Component-ize that and you have a nice offering - get d-n-d sorted out and you have a killer offering. If you have a functional replacement for more expensive IE only solutions, you will have killed some market for some folks. You might want to capitalize on that.
Reply
That's what I was thinking. See the thread with Cass above though. Kind of pissed on my chips that did. I've not given up on finding a solution yet, but that single bug has rendered all the work on the file manager component pretty much useless.
Reply
Show the rest of this thread
Hi Jake, "Flex, on aime!".
And what about adding a "real" search tool using the database index rather than the (nice, but equivalent) "filter" function ? (i.e. same behaviour as classic Domino Web sites) ?
Thank you for your fantastic job. Greetings from Geneva!
Alex
Reply
I cant believe it. Its actually here for Domino. I have been trying to use flash for over a year to create a multiple upload solution. I knew you would be the one to do it. I beg of you to please release the code or provide a walk through on how did it. PLEASE!
This is actually something I would pay for. I think after all the free code and tips you have provided us over the years that this is something you should break down and charge for. IBM should pick this up from you and include it in the next release. It's time you got something for your many efforts. Even in its raw as is stage I would be happy to donate to any cause you see fit.
In the meantime...can we get that code? :)
Reply
Glad you like Robert.
If I were to charge for something then I'd have to be completely happy with it. As it is I'm not, because of the Flash player bug detailed above. Until that's resolved any alternative is what I'd consider a hack and not what I'd want to bill people for.
If you want to donate to some worth cause (Haiti for example) and forward me proof of it then I'll send over a pre-release version of the code...
Reply
Maybe the solution is closer to home...
using xpages I found this example, maybe there's a way to hook into this with flex somehow.
http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/GROC-7G3GF7
Reply
Hi, can I download the example database and fool around with it?
Thanks in advance,
JD
Reply
See here:
http://www.codestore.net/store.nsf/unid/BLOG-20100210-0329/
Reply