AddAttachment for images not on disk (video capture)

453
3
04-03-2013 01:27 PM
ChrisMusial
New Contributor
I'd like to use a mobile device's camera to capture an image and then upload that image as a feature attachment.  No problem getting the image from the camera.  I create an <img> tag, and set the src to be a data URI, and show it on the web page in a gallery.  Once satisfied, I'd like to upload each image as an attachment to the selected feature.  They're obviously not stored on disk, so how can I upload the images when the API requires that the attachment be specified using a file upload field in a form?

Appreciate any insight!
0 Kudos
3 Replies
CharmaleeSandanayake
New Contributor III
Not sure if this is exactly what you want but try this link: http://blogs.esri.com/esri/arcgis/2010/09/01/building-web-applications-for-ios-and-android-using-doj...

When you scroll down it describes ways to make the camera accessible to your device.

I am hoping to do something similar for an iPad so let us know how it goes.
0 Kudos
ChrisMusial
New Contributor
Not sure if this is exactly what you want but try this link: http://blogs.esri.com/esri/arcgis/2010/09/01/building-web-applications-for-ios-and-android-using-doj...

When you scroll down it describes ways to make the camera accessible to your device.

I am hoping to do something similar for an iPad so let us know how it goes.


Thanks for the reply.  Making the camera accessible to the device isn't the problem for me - my issue is that I grab the images from the camera and store them as an object in memory, but the addAttachment method seems to require them to be in a file which the user then has to browse for and select.  The example you provided follows this same approach:  the user needs to browse for the pictures and then select them.  My application allows the user to snap pictures and places them in a gallery of thumbnails on the web page.  The user can remove images from that gallery or continue snapping pictures to add to the gallery.  Once done, they can click 'Save', and this should upload all the images in the gallery as attachments to the current feature.  It wouldn't make sense to require the user to the go and individually browse for and select image files for each image in the gallery.
0 Kudos
JamesFinerfrock
New Contributor
Was there any solutions on using addAttachment without using the form based method?  I too would like to attach a user files that is not selected using a form....
0 Kudos