Upload Photo Using HTML5
I'm developing a HTML5 and jQuery based iPad application.I need to upload
an image to the server. The server url is
https://myserver.myclient/myproject/uploadphotos
I need to have the request data like below { "FileName": "abc.jpg",
"FileDescription": "Description of file", "FileData": "Base64 encoded
String", "LibraryId": "libraryId", "FileTitle": "First File" }
The HTML code part for file upload section is as below,
<tr>
<td class="ui-table-priority-1">
<div class="ui-input-text ui-shadow-inset ui-corner-all
ui-btn-shadow ui-body-c ui-input-has-clear">
<input type="file" name="file" id="file" value=""
data-clear-btn="true" class="ui-input-text ui-body-c">
<a href="#" class="ui-input-clear ui-btn ui-btn-up-c
ui-shadow ui-btn-corner-all ui-fullsize ui-btn-icon-notext
ui-input-clear-hidden" title="clear text"
data-corners="true" data-shadow="true"
data-iconshadow="true" data-wrapperels="span"
data-icon="delete" data-iconpos="notext" data-theme="c"
data-mini="false"><span class="ui-btn-inner"><span
class="ui-btn-text">clear text</span><span class="ui-icon
ui-icon-delete ui-icon-shadow"> </span></span>
</a>
</div>
</td>
<td class="ui-table-priority-2">
</td>
</tr>
I was able to get the parameters like filename,filedescription,filetitle
and library id. I need to get the base64Encoded String for "File Data" and
also the code for posting the same to the server.
Please help me out in uploading the photo.The project I'm woking is using
HTML5,jQuery Mobile and JavaScript only.
Thanks in advance,
Abin
No comments:
Post a Comment