0

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.

2
  • Are you using google cloud storage? or you want to store in blobstore? Commented Nov 25, 2014 at 0:13
  • @Puran After some more reading, ideally GCS, but if blobstore gets the job done I could quite happily switch. I've read this guide and was feeling quite happy with it, but I'm starting to think it's purely for testing source code locally. Commented Nov 25, 2014 at 0:41

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much for the link! Although I managed to figure it out myself in the end, my solution was very similar to yours, so I hope it will help anyone looking for an answer.
1

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.

1 Comment

Oh BTW: I missread your question, you have been asking about files to cloudstorage not applications to appengine. My answer addresses the second one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.