0

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

1

2 Answers 2

1

https://github.com/claudemamo/file-attach-cordova-upload-jqm use this

Sign up to request clarification or add additional context in comments.

Comments

0

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>

1 Comment

thanks for the reply but in my android application the button choose file does not allow me to choose file and always displays error.. Do I need to add any extra permissions in manifest file, so as to enable choose file button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.