Telerik Forums RSShttp://www.telerik.com/urn:uuid:c4c082b8-88a9-43c0-9e3c-b99596065eb8http://www.telerik.com/forums/permalink/uILAxKmIwEOePLmVlgZeuAsending an image file to web serviceHello Michael,<br />
<br />
I think this is required due to the fact that photos selected from the device's gallery are not downscaled to a lower quality, even if a <code>quality</code> parameter is specified.<br />
<br />
Regards,<br />
Steve <br />
Telerik
<div class="forumBaloonTop"></div>
<div class="forumBaloon">Icenium is now <strong>Telerik AppBuilder</strong>, and is part of the <a href="http://www.telerik.com/platform">Telerik Platform</a>. For more information on the new name, and to learn more about the Platform, register for the <a href="http://www.mobileappsaredead.com/ ">free online keynote and webinar</a> on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT)
</div>
<div class="forumBaloonBottom"></div>urn:uuid:d7c81e9b-b1f5-4032-bcd9-c92834dd0cd5http://www.telerik.com/forums/permalink/mx7I1_WxMkC82ckoNN0M1Qsending an image file to web serviceThere seems to be a restriction on file size/dimensions. We couldn't send photos taken via the app without specifying the dimension settings. Curiously, those same photos, if selected from the photo library, would not send unless we again specified the dimensions; though, photos taken directly through the phone's camera program will send via photo library selection regardless of specification.&nbsp;urn:uuid:9388501e-1d38-40a3-b430-0b8f4eea511ehttp://www.telerik.com/forums/permalink/HlCIkzgdo0C0MAuPTupRHgsending an image file to web serviceHello Michael,<br />
<br />
Thanks for sharing your solution. <br />
<br />
We noticed that our FileTransfer sample has only download functionality and we plan to extend it &nbsp;to demonstrate how to upload files as well.<br />
<br />
Regards,<br />
Kristian D. Dimitrov <br />
Telerik
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
<p style="line-height: normal; margin: 0in 0in 10pt;" class="MsoNormal"><span style="font-size: 7pt; font-family: arial,sans-serif; color: #333333;">
Explore the entire Telerik portfolio by </span><a href="http://www.telerik.com/download-trial-file.aspx?pid=763"><span style="font-size: 7pt; text-decoration: none; font-family: arial,sans-serif; color: #3366cc;">downloading Telerik DevCraft Ultimate</span>.</a></p>
</div>
<div class="forumBaloonBottom"></div>urn:uuid:0253f884-622c-41fa-8672-f02037ae1853http://www.telerik.com/forums/permalink/hPhTAixi-kGGcvAgN64YUwsending an image file to web serviceThe solution to all of these issues was just this:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destinationType: that._destinationType.FILE_URI,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; encodingType : navigator.camera.EncodingType.JPEG,&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; quality: 40,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; targetWidth: 500,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; targetHeight: 500,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; saveToPhotoAlbum: 1<br />
<br />
and setting the extra 'true' parameter on the upload...urn:uuid:c852f9bd-f17f-6246-8b24-ff0000f4596dhttp://www.telerik.com/forums/permalink/vflSyH_xRmKLJP8AAPRZbQsending an image file to web serviceOkay, very slight progress:<br />
<br />
Using:&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ft.upload(imageURI, encodeURI("http://service.etc/etc/etc"), win, fail, options, true);<br />
<br />
(Just added ", true" into it and everything sends fine...)<br />
<br />
works, BUT - only on iOS and only for retrieving photos from the photo library. Taking a new photo fails. I believe this is because it is saved into a temp directory and the URI it tries to send is no good.<br />
<br />
So, how can we move the image into permanent storage, and what about android? android just gives error code 1 and 3. which are not errors from the server. the ft.upload itself is failing.urn:uuid:aa52f9bd-f17f-6246-8b24-ff0000f4596dhttp://www.telerik.com/forums/permalink/vflSqn_xRmKLJP8AAPRZbQsending an image file to web servicewe want to have a feature where the user takes a photo and then that photo is sent to a web service to be stored.<br />
<br />
We are using:<br />
<br />
function cameraApp () {};<br />
<br />
cameraApp.prototype={<br />
&nbsp; &nbsp; _pictureSource: null,<br />
&nbsp; &nbsp; _destinationType: null,<br />
........<br />
<br />
to get the picture. We can get:&nbsp;&nbsp;destinationType: cameraApp._destinationType.FILE_URI,<br />
or:&nbsp;&nbsp; destinationType: cameraApp._destinationType.DATA_URL<br />
<br />
That works great. We display the output in an IMG tag, either way. The issues all seem to be with the sending part.. We tried:&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ft.upload(imageURI, encodeURI("http://service.etc.etc/etc/service"), win, fail, options);<br />
<br />
with any number of different configurations, etc. It doesn't do anything. It returns error code 1 or 3, and has never reached the server or returned the service response.<br />
<br />
we tried passing the URI along to let the service to let it access the file, but then we have all kinds of issues about unable to resolve URI, etc.<br />
<br />
this:<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var formData = new FormData();<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; formData.append("myfile", blob, imagefilename);<br />
&nbsp; &nbsp; &nbsp; &nbsp; var request = new XMLHttpRequest();<br />
&nbsp; &nbsp; &nbsp; &nbsp; request.open("POST", "http://service..etc.etcetc");<br />
&nbsp; &nbsp; &nbsp; &nbsp; request.send(formData);<br />
<br />
works perfectly, just - not on any mobile devices. works great in the simulator, but thats it.<br />
<br />
We seem to be running out of ideas. Obviously, any number of mobile apps have this capability. So, what have others done successfully? This seems like it ought to be simple.