Hi Kim I am very new to GWT .
I have to make a web application which uploads the file. The file can be of type .doc , .txt The file size can be more then 1 MB. I dont know how to do it. Some body suggested me to use BolbStore. After suggesting he didnt replied once also. files used for BlobStore * import* javax.servlet.ServletException; *import* javax.servlet.http.HttpServlet; * import* javax.servlet.http.HttpServletRequest; * import* javax.servlet.http.HttpServletResponse; *import* com.google.appengine.api.blobstore.BlobKey; * import* com.google.appengine.api.blobstore.BlobstoreService; * import* com.google.appengine.api.blobstore.BlobstoreServiceFactory; Plz help me . i am stuggling with this from a very long time. On Thu, Mar 8, 2012 at 9:29 AM, kim young ill <khi...@googlemail.com> wrote: > need to be more specific what your BlobstoreService is doing/used library > > > On Wed, Mar 7, 2012 at 4:01 PM, learning coding < > learning.codin...@gmail.com> wrote: > >> Hi all , >> >> I have to make webapplication using java, >> I have to upload a file which is bigger then 1MB . >> Actually i need the contentStream of the file and the value of the >> textBox which is on the FormPanel ,on the myProject.server side . >> >> The file can be of .txt and .doc type. >> >> Somebody suggested me to use BolbStore. >> >> >> My Code : >> >> Code >> client >> // Get The URL >> public void onClick(ClickEvent event) { >> System.out.println("blob" +blobServices); >> blobServices >> .getBlobStoreUploadUrl(callback) ; >> } >> }); >> >> // >> ..Some more code >> >> public void onSubmitComplete(SubmitCompleteEvent event) { >> >> Window.alert(event.getResults()); >> } >> >> }); >> >> The above RPC call is working fine i am able get the URL. >> Now i have to use this URL with servlet which is used to upload a >> file. >> >> AsyncCallback callback = new AsyncCallback() { >> >> public void onFailure(Throwable caught) { >> // TODO Auto-generated method stub >> caught.printStackTrace(); >> } >> >> public void onSuccess(Object result) { >> String tmp = result.toString(); >> uploadForm.setAction(tmp); >> >> // Submit the form to complete the upload >> uploadForm.submit(); >> uploadForm.reset(); >> } >> }; >> >> On server Side >> >> public class UploadServiceImpl extends HttpServlet { >> >> BlobstoreService blobstoreService = >> BlobstoreServiceFactory.getBlobstoreService(); >> >> public void doPost(HttpServletRequest req, HttpServletResponse >> res) >> throws ServletException, IOException { >> >> Map<String, BlobKey> blobs = >> blobstoreService.getUploadedBlobs(req); >> BlobKey blobKey = blobs.get("upload"); >> >> if(blobKey == null){ >> res.sendRedirect("/"); >> }else{ >> res.sendRedirect("/serve?blob-key=" >> +blobKey.getKeyString()); >> } >> } >> >> } >> >> With this Code I am able to view only the .txt file on >> Window.alert(event.getResults()); >> and also the size of .txt file is greater then 2 MB. >> >> But when i submit the xyz.doc file it gives option to save file and >> also the name of the file xyz.doc is changed to serve.doc >> the size of the file is 130 KB. >> >> Plz tell me what to do. file can be of type .txt or .doc with size >> greater then 1 MB. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Web Toolkit" group. >> To post to this group, send email to google-web-toolkit@googlegroups.com. >> To unsubscribe from this group, send email to >> google-web-toolkit+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/google-web-toolkit?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.