Web Client Multiple File Selection

Forum to discuss the Web client version of Servoy.

Web Client Multiple File Selection

Postby keenkenny » Fri Mar 23, 2012 1:17 am

Can the HTML5 multiple file input type be integrated with the web client utilities plugin and pass the selected filenames back via a callback script?

The sample code below, inserted into an non-editable HTML area will display a Choose Files button in the web client and will allow multiple files to be selected in the dialog. When the dialog is closed, it then shows a count of the files selected. My understanding is this input function returns an array of filenames. Can that array be picked up and sent back to the server using the web client utils plugin, or?

Code: Select all
var htm = '<html>'
htm += '<head>'
htm += '<script> function triggerCallback(returnValue) {' + plugins.WebClientUtils.generateCallbackScript(callback, ['returnValue']) + '}</script>'
htm += '</head>'
htm += '<body>'

//DISPLAYS A 'CHOOSE FILES' BUTTON AND ALLOWS MULTIPLE FILES TO BE SELECTED
htm += '<input name="uploads" type="file" multiple> <input type="submit">'

htm += '</body>'
htm += '</html>';
Ken Keen
KeenEyes Interactive, Inc.
SAN Developer
keenkenny
 
Posts: 70
Joined: Sun Jun 01, 2003 10:31 pm
Location: Cedar City, UT

Re: Web Client Multiple File Selection

Postby jcompagner » Mon Mar 26, 2012 4:50 pm

You have to submit a form then and handle the file streams at the server side, thats not that easy doable
For this our fileupload pages could support such a thing, problem is that it is quite well supported except for IE ...

http://www.w3schools.com/html5/att_input_multiple.asp
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 5 guests