Reputation: 74
I want to upload a video to youtube from my installable android application. Is there a way to do it by javascript only without calling native android codes
Upvotes: 0
Views: 588
Reputation: 74
https://github.com/claudemamo/file-attach-cordova-upload-jqm use this
Upvotes: 1
Reputation: 3698
This JavaScript function, confirms that the user has selected a file to upload. If the user has not selected a file, then the function displays an error message.
<script type="text/javascript">
function checkForFile() {
if (document.getElementById('file').value) {
return true;
}
document.getElementById('errMsg').style.display = '';
return false;
}
</script>
<form action="URL?nexturl=http%3A%2F%2Fwww.example.com" method="post"
enctype="multipart/form-data" onsubmit="return checkForFile();">
<input id="file" type="file" name="file"/>
<div id="errMsg" style="display:none;color:red">
You need to specify a file.
</div>
<input type="hidden" name="token" value="TOKEN"/>
<input type="submit" value="go" />
</form>
Upvotes: 0