Upload image to Google Storage? - java

I need to send a file to a servlet which will then upload the file to google cloud storage.
I cannot upload the file directly from the JSP page, I need this action will be from the servlet.
I have tried so many things that I don't know what to paste here.
I have uploaded a file to google cloud storage(GCS), but GCS doesn't know what the file is and cannot open it.

Related

How to upload edittext content to Google Drive as a Google Doc?

I want to upload edittext content to Google Drive as a Google Doc, is there anyway to do this in Android?
Do the following things -
Create a File and save editText content in that file and save the file in your external storage.
Use Drive API to upload this file to google drive check the below document.
Check this link - google drive integration in android

How should I design my application flow for working with google doc files?

I have an application which is supposed to automatically fill placeholders of one google doc file and clone the result into the user's drive. Once I upload the doc file into developer's drive and when logged-in user requests resolved doc file, the following processes occur:
Gather information related to the user from remote services.
Get google doc file from developer's drive.
Parse placeholder from google doc file and replace them with gathered info.
Save resulting file as json into the database.
Upload resulting file into the user's drive.
As soon as file is uploaded - share link with user. Also give user the ability to download generated file as .docx.
The question is if it's possible to implement all steps using Java Google Docs API? Also I am not sure if the step with downloading file as .docx possible to implement?

Upload files to Google Drive from App Engine application

I'm trying to implement App Engine app that should upload files from user computer to Team Drive folder.
Currently I'm trying to do it with .jsp and servlets but it seems that it couldn't be done that way.
I'm using Service Account and Drive API Client Library for Java - https://developers.google.com/api-client-library/java/apis/drive/v3
It seems that when uploading files in such way you should use java.io.File which is impossible on App Engine, because file isn't stored on instance but it is uploaded from user computer.
Is it any way to upload file directly to Google Drive using App Engine?
Additional note:
I'm using Drive API v3.
In Drive API v2 there was file.insert() method available which lets you sending InputStream as input parameter. I think such method could help me with upload but it is not included in API v3.
https://developers.google.com/drive/api/v2/reference/files/insert
I think you're looking for protected Create(File content, com.google.api.client.http.AbstractInputStreamContent mediaContent) from https://developers.google.com/resources/api-libraries/documentation/drive/v3/java/latest/

Play Framework file upload to in memory to S3

I am writing a web server with Play framework 2.6 in Java. I want to upload a file to WebServer through a multipart form and do some validations, then upload the file s3. The default implementation in play saves the file to a temporary file in the file system but I do no want to do that, I want to upload the file straight to AWS S3.
I looked into this tutorial, which explains how to save file the permanently in file system instead of using temporary file. To my knowledge I have to make a custom Accumulator or a Sink that saves the incoming ByteString(s) to a byte array? but I cannot find how to do so, can someone point me in the correct direction?
thanks

Upload .mp3 file in Google Cloud Storage using Java client JSON API

Is it possible to upload a mp3 file (audio file) in Google Cloud Storage using Java client library.
I can access my bucket from Cloud Storage and can read the content of my bucket using Java client library JSON API.
If it is possible can anyone please refer a url path from where I can start or get an idea to upload mp3 file.

Categories