Barrex
Barrex

Reputation: 7

Uploading files to Google App Engine using Java without a web interface

I'm attempting to write an application for Google App Engine using Java. Part of what I'd like to do is allow a user to select a file using a Swing interface which then gets uploaded to GAE. Every example and tutorial I found seems to indicate that a web interface is required, but that's something I'd rather avoid.

I appreciate the question is quite vague and I haven't specified a particular storage method (such as datastore or blob) because I'm unsure what would be more appropriate given this scenario. My main focus here would be to remove the need for web browser involvement.

Could somebody point me in the right direction? I imagine this must be doable, but I haven't been able to find anything relevant. I'm not after an obvious example or anything like that, but a starting point or a brief description of how this concept would function would be massively appreciated.

Upvotes: 0

Views: 226

Answers (2)

Puran
Puran

Reputation: 994

I have used GAE to upload file from iOS client to GCS. I documented it in this blog http://narup.blogspot.com/2014/11/uploading-to-google-cloud-storage-from.html since lot of people were looking for it. I am sure you can do something similar on servlet side and use java http client to make a POST request

Hope this helps

Upvotes: 1

eckes
eckes

Reputation: 10423

The appengine-maven-plugin for GAE is actually constructing a command line call to the GAE SDK, as you can see here. This is IMHO the Python version of the commands.

However reading the GAE documentation, you should be able to use com.google.appengine.tools.admin.AppCfg in appengine-java-sdk/lib/appengine-tools-api.jar instead. And from that code, I am quite sure one does not want to code this yourself.

Upvotes: 1

Related Questions