Sie können mich buchen für:
Individuelle Schulungen für XPages, JavaScript und Appcelerator Titanium Software-Entwicklung für IBM XPages, Appcelerator Titanium (Mobile Apps iPhone, iPad, Android, Blackberry 10), Mobile Web und IBM Notes
Did anyone made the HTML5 multi upload control work with XPages?
Julian Buss, March 1st, 2012 12:49:45
Tags:  xpages 
In HTML5, you can add the "multiple" attribut to a [input type="file"] tag. WIth that attribute you can select multiple files and upload them to the server all at once, without the need for Flash.

I tried some things around this technique in Domino 8.5.3 and XPages, but without luck so far. There seems to be a problem with the XSP FileUpload code, on the Domino console I get the message

com.ibm.xsp.http.fileupload.FileUploadException: Array index out of range: 1.

So in the XSP backend there seems to be something hardcoded to allow only one file in the HTTP POST payload. I have some ideas to create workarounds, but they are all pretty complicated and I'm looking for a more simple solution.

Did anyone played with HTML5 multi file uploads yet and succeeded?

P.S. I am aware of the multi file upload control on OpenNTF, but that uses Flash, which is a no-go for my current project.
Comments (9) | Permanent Link

Comments:

1) Did anyone made the HTML5 multi upload control work with XPages?
Tommy Valand 01.03.2012 13:28:51

I haven't tried it, maybe this might be of help (using XHR to post files):

{ Link }

2) Yes.
Tim Tripcony 01.03.2012 15:43:40

Julian, as of last week, I have a working implementation, complete with Dijit progress bars. I'm requesting permission to open source it (it was developed for use in our Transformer Extension Library), but even if I'm not able to, I can confirm that it is possible using just the JavaScript File API, a JSON-RPC service, and the standard XPages runtime.

3) Did anyone made the HTML5 multi upload control work with XPages?
Julian Buss 01.03.2012 15:50:04

Tommy, thanks for the link. It gave me inspiration.

Tim, going via JSON-RPC is a good idea, too. But at the moment, I'm on a track to another solution. Stay tuned :)

4) Did anyone made the HTML5 multi upload control work with XPages?
Julian Buss 01.03.2012 21:41:28

I believe I found a good and elegant solution and will write about it next week :-)

5) Did anyone made the HTML5 multi upload control work with XPages?
Tommy Valand 02.03.2012 08:01:23

Nice.. :)

If you have the time, could you mention if there are any performance difference/other advantages by using the HTML 5 file api?

I would think less initial loading, since you're not loading flash. Also you are using the same HTTP session, whereas in the FileUploadControls I've tested, flash has it's own session as Anonymous, which leads to some "hacks" when it comes to access control.

6) Did anyone made the HTML5 multi upload control work with XPages?
Mark Leusink 02.03.2012 13:52:55

You're right: the multi file upload control on OpenNTF uses SWFUpload which is a Flash component.

I embedded another multi file upload control called PLUpload in Bildr a while back (also available on OpenNTF). It's configured to use HTML 5 based uploads in supported browsers (and if HTML5 isn't available automatically fall back to use Silverlight, Flash or eventually HTML4).

I did look at the source and it appears to also be using the "XMLHttpRequest Level 2" specs in the link Tommy added.

I'm curious about the solution you came up with.

7) Did anyone made the HTML5 multi upload control work with XPages?
Mark Leusink 02.03.2012 14:18:01

It also has drag and drop support from the desktop in browsers that support HTML5.

BTW: The current release on OpenNTF of Bildr (3.3) doesn't work in Firefox 10 due to a bug in PLUpload. I've fixed that in a newer release and will try to update it on OpenNTF. Let me know if you want it.

8) Did anyone made the HTML5 multi upload control work with XPages?
Julian Buss 02.03.2012 21:04:56

I described my solution here: { Link }

9) Did anyone made the HTML5 multi upload control work with XPages?
Julian Buss 02.03.2012 21:07:17

correction, new link: { Link }

Add a comment
Subject:
   
Name:
Mail:
Web:
 
Comment:  (No HTML - URLs with leading http://)
 
remember me?   
You can hire me.
See my Linkedin profile for details.

Thanks for reading and have a nice time here!

Please note my Apps for iPhone and iPad: NotesBook: takes your Lotus Notes Notebook (Journal) to your iPhone and iPad xpageswiki.com: huge XPages Tips & Tricks collection for iPhone and iPad