Hmm, how big is your file? Perhaps your proxyhas some request body limitations?
http://www-01.ibm.com/support/docview.wss?rs=899&uid=swg21304758 Eric On Tue, Jun 23, 2009 at 11:15 PM, bhagya <bhagyagde...@gmail.com> wrote: > > Hi Eric, > Thank you for the reply. > Before turning on debbuging I did the following. > I tried thru static ip (instead of proxy may be our proxy might be > having some restrictions) and now I get the following error. I can > download a file from the GoogleDocs. But if I try to upload any file > (even doc file which is downloaded from GoogleDocs) fails. > I am using files from gdata-src.java-1.33.0.zip > > Exception in thread "main" java.io.IOException: Error writing request > body to server at sun.net.www.protocol.http.HttpURLConnection > $StreamingOutputStream.checkError(Unknown Source) > at sun.net.www.protocol.http.HttpURLConnection > $StreamingOutputStream.write(Unknown Source) > at java.io.BufferedOutputStream.flushBuffer(Unknown Source) > at java.io.BufferedOutputStream.flush(Unknown Source) > at com.google.gdata.data.media.MediaSource$Output.writeTo > (MediaSource.java:90) > at com.google.gdata.data.media.MediaBodyPart > $MediaSourceDataHandler.writeTo(MediaBodyPart.java:74) > at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403) > at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:874) > at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:444) > at > com.google.gdata.wireformats.output.media.MediaMultipartGenerator.generate > (MediaMultipartGenerator.java:58) > at > com.google.gdata.wireformats.output.media.MediaMultipartGenerator.generate > (MediaMultipartGenerator.java:37) > at com.google.gdata.client.Service.writeRequestData(Service.java: > 1813) > at com.google.gdata.client.media.MediaService.insert > (MediaService.java:389) > at sample.docs.upload_new.uploadFile(upload_new.java:41) > at sample.docs.upload_new.main(upload_new.java:21) > > Can u please check if i am missing something... > Regards > - Bhagya > On Jun 23, 10:35 pm, Eric Bidelman <api.e...@google.com> wrote: > > Can you turn on debugging and see where that gets us? > http://code.google.com/apis/gdata/articles/debugging_client_libs.html > > > > <http://code.google.com/apis/gdata/articles/debugging_client_libs.html > >Eric > > > > > > > > On Tue, Jun 23, 2009 at 4:23 AM, bhagya <bhagyagde...@gmail.com> wrote: > > > > > Hi, > > > > > I am trying to upload the document as below. The example is taken > > > from the latest java-guide. > > > Even when I execute the sample program (DocumentListDemo) I get the > > > same problem. > > > > > The code for uploading the file is as below... > > > File file = new File(filepath); > > > DocumentListEntry newDocument = new DocumentListEntry(); > > > String mimeType = DocumentListEntry.MediaType.fromFileName > > > (file.getName()).getMimeType(); > > > newDocument.setFile(new File(filepath), mimeType); > > > // newDocument.setFile(new File(filepath)); > > > newDocument.setTitle(new PlainTextConstruct(title)); > > > > > return client.insert(new URL("http://docs.google.com/feeds/ > > > documents/private/full/"), newDocument); > > > > > The error I get is > > > Exception in thread "main" > > > com.google.gdata.util.ServiceException: Proxy Error ( The connection > > > was reset by a peer. ) > > > > > I have given the proper proxy settings and validated the service using > > > setUserCredentials() method. I can read the documents list but if I > > > try to upload the file, I get the error.- Hide quoted text - > > > > - Show quoted text - > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Docs Data APIs" group. To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com To unsubscribe from this group, send email to google-docs-data-apis+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---