}
// step 2 : save file into blobstore
FileService fileService = FileServiceFactory.getFileService();
// TODO : make mimetype configurable by user
AppEngineFile file = fileService.createNewBlobFile("text/plain", fileName);
// Open a channel to write to it
FileWriteChannel writeChannel = fileService.openWriteChannel(file, true);
writeChannel.write(ByteBuffer.wrap(rawData));
writeChannel.closeFinally();
logger.info("Uploaded file name : " + fileName + " path : " + file.getFullPath() + " with size = " + rawData.length);
// step 3 : send result back to client
BlobUploadResult result = AutoBeanUtil.newBlobUploadResult(Status.SUCCESS, fileName, rawData.length);
resultStr = AutoBeanUtil.encode(BlobUploadResult.class, result);
} catch (FileUploadException e) {