0

I need a help with upload a file to google storage(blobstore or google cloud storage), and i already did that send a message to server and then the server will response the message back. There are the code i alredy did a little bit below, could anyone help me how to upload a file to clound storage by using java application.

I dont use jsp or html as a upload interface, i design a simple javaGUI to upload a file when click a upload button.

I can not find any reference online, most of cases used jsp, html or php as a interface to upload a file.

i had some problem with code posted, so i put my code in the dropbox.

Server side: enter link description here

Client side: enter link description here

user2141529
  • 19
  • 1
  • 1
  • 5

1 Answers1

1

First of all you will have to complete the fully functional example that actually works for uploading files on Blobstore or Google Cloud Storage. No matter what are you going to use for uploading stuff, this is a must thing to do to verify that the backend part works and the part that is done in JSP will be your testing environment for making sure that the backend works before implementing anything else.

Once this is done then all you have to do from your JavaGUI app is to make sure that you know how to upload files using the the multipart file upload POST request.

Lipis
  • 21,388
  • 20
  • 94
  • 121
  • Hi Lipis, Thanks for reply soon. Actually, i already did the upload a file by using blob. This is what i did [link]http://stackoverflow.com/questions/15256857/how-to-transfor-jsp-to-java-application-upload-file-to-blobstore This is the all project[link]https://dl.dropbox.com/u/14562196/Blobstore1.rar – user2141529 Mar 07 '13 at 17:21
  • But i was using jsp for uploading a file. Could u teach me how to use javaGui(Java application) to upload the file by using blobstore or restful. Thank you!! – user2141529 Mar 07 '13 at 17:27
  • @user2141529 did you follow the example from google? the link that I have in the answer? – Lipis Mar 07 '13 at 17:32
  • @user2141529 if you did it and it works from the browser.. then all you have to do is to simulate the upload form from your Java GUI application.. – Lipis Mar 07 '13 at 18:59
  • Could you give me a example what i need to do in client side after i upload my server side i made as followed by google. The link you post it. its using httpclient, but i really dont know how to connect to server side. – user2141529 Mar 07 '13 at 19:19
  • you mean upload form is jsp file?? – user2141529 Mar 07 '13 at 19:20
  • @user2141529 Did you or did not have a working example that works from a browser and deployed on appspot.com? – Lipis Mar 07 '13 at 19:31
  • yes, i did. This is what i did [link]https://dl.dropbox.com/u/14562196/11.png and it can upload a file to blobstore. – user2141529 Mar 07 '13 at 19:34
  • @user2141529 we can't go any further in these comments... but the next step is to make use of this answer http://stackoverflow.com/a/1379002/8418 where you can see how to upload stuff.. but before that you have to get the upload url which is also part of your exercise.. Basically you have to do whatever the browser does.. get the upload URL from the server and the send a post request with the file.. there are plenty of tutorials and examples online.. this answer is one of them – Lipis Mar 07 '13 at 19:45
  • Thanks Lipis, i will try to do more research and try to make it work. – user2141529 Mar 07 '13 at 20:07
  • @user2141529 What's the status with this one... did you managet to solve it? If this answer helped.. you can mark it as accepted.. http://meta.stackexchange.com/a/5235/142717 – Lipis Mar 15 '13 at 09:32