In JavaScript, I made blob and ObjectURL for the blob.
However I'm not sure how I could send this blob to Servlet so I could store in Google App Engine Storage.
By searching on Google, I found I could upload file to Servlet by using the following code.
<form method="POST" action="upload" enctype="multipart/form-data" >
<hidden input type="file" name="file" id="file" /> <br/>
<input type="submit" value="Upload" name="upload" id="upload" />
However, I still can't figure out how to put my blob in that form.
So, this is what I've written so far.
function saveRecording(blob) {
url = URL.createObjectURL(blob);
html = "<form method=\"POST\" action=\"upload\" enctype=\"multipart/form-data\" >" +
.... +
"<input type=\"submit\" value=\"Upload\" name=\"upload\" id=\"upload\" />"
$recordingList.prepend($(html));
}
I also had tried to send blobURL to Servlet and let Servlet to download the blob file from the URL but it also didn't work...
Thank you.