form uploader and mobile camera

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

form uploader and mobile camera

kenfeldt

We are using the dojox/form/uploader on a desktop application to transfer image files to the server. Works great.

In the mobile setting, we are trying to get the same functionality using the HTML5 camera capture attributes. Things 'sort of' works when we try:

 <input id='attachedImg' type="file" accept="image/*" capture="camera"
   data-dojo-type="dojox/form/Uploader" id="attachedImg"  data-dojo-id="attachedImg"
   data-dojo-props="multiple:false, label:'Image', onComplete:function(result) {}, onError:function(evt) {}, onChange:function(files) {}" />


The only problem is that we lose the filename display next to the upload --- is there some magic sauce we can try to use the uploader that will preserve the filename display?

--
Electric Book Company, LLC
Turning Content Into Community
804-514-6149
read.electricbook.net (Calculus Review)
www.group-study.net (public site)
www.electricbook.net (company site)

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: form uploader and mobile camera

dylanks
Hi Ken,

Unfortunately I don't think there's a way to access the photo file name from within a mobile browser. From JS, most HTML5 APIs that involve files are write only, meaning you can add files to an object to be uploaded, but there's no option to introspect on that data from the client-side.

Probably your best option would be to upload the file in the background, read the metadata, and send that data back to the client-side for displaying the file name. That of course may not be what you want to do!

Dylan Schiemann
SitePen, Inc.
t: 650.968.8787
Sent from my iPhone

On Jan 31, 2017, at 20:26, Ken Feldt <[hidden email]> wrote:

We are using the dojox/form/uploader on a desktop application to transfer image files to the server. Works great.

In the mobile setting, we are trying to get the same functionality using the HTML5 camera capture attributes. Things 'sort of' works when we try:

 <input id='attachedImg' type="file" accept="image/*" capture="camera"
   data-dojo-type="dojox/form/Uploader" id="attachedImg"  data-dojo-id="attachedImg"
   data-dojo-props="multiple:false, label:'Image', onComplete:function(result) {}, onError:function(evt) {}, onChange:function(files) {}" />


The only problem is that we lose the filename display next to the upload --- is there some magic sauce we can try to use the uploader that will preserve the filename display?

--
Electric Book Company, LLC
Turning Content Into Community
804-514-6149
read.electricbook.net (Calculus Review)
www.group-study.net (public site)
www.electricbook.net (company site)

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Co-Founder, Dojo Toolkit
CEO, SitePen, Inc.  http://www.sitepen.com/