I have a HTML form like this,
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit"value="upload"/>
</form>
Using the File service in GAE with below code am storing the data in google app engine.
FileService fileService = FileServiceFactory.getFileService();
AppEngineFile file = fileService.createNewBlobFile(mime, fileName);
boolean lock = true;
byte[] b1 = new byte[BUFFER_SIZE];
int readBytes1;
FileWriteChannel writeChannel = fileService.openWriteChannel(file, lock);
while ((readBytes1 = is1.read(b1)) != -1) {
writeChannel.write(ByteBuffer.wrap(b1, 0, readBytes1));
}
writeChannel.closeFinally();
Does this File service stores the uploaded file as Blob values in Google App engine.
- Before using the File service i tried with
createUploadUrl()method directly in HTML form which stored the files as blob values and i can view the blob too using “View Blob” in the google app engine. - Now after using this file am seeing only the key of the file, not the option ” View Blob” can anyone say why this happens.
Please refer to the link below. Here Apache Common File Upload is shown.
How to handle html5 input multiple in java gae