Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Error when trying to upload a file #271

Open
GoogleCodeExporter opened this issue Apr 6, 2015 · 0 comments
Open

Error when trying to upload a file #271

GoogleCodeExporter opened this issue Apr 6, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Make a valid connection to the google account
2.try to upload a doc file using gdata-1.41.2
3.

What is the expected output? What do you see instead?

File should be uploaded on google data of the account but instead it is 
throwing the following error:
com.google.gdata.util.InvalidEntryException: Could not convert document.
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>InvalidEntryException</code>
<internalReason>Could not convert document.</internalReason>
</error>
</errors>

    at 
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse
(HttpGDataRequest.java:590)
    at 
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse
(GoogleGDataRequest.java:563)
    at com.google.gdata.client.http.HttpGDataRequest.checkResponse
(HttpGDataRequest.java:550)
    at com.google.gdata.client.http.HttpGDataRequest.execute
(HttpGDataRequest.java:530)
    at com.google.gdata.client.http.GoogleGDataRequest.execute
(GoogleGDataRequest.java:535)
    at com.google.gdata.client.media.MediaService.insert
(MediaService.java:400)


What version of the product are you using? On what operating system?
gdata 1.41.2 on windows XP SP3

Please provide any additional information below.

I am trying to upload a doc file and i am able to make valid connection to 
google account but unable to upload any doucument. Here is my code for 
uploading:
File file = new File("D:\\Testing.doc");
String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName
()).getMimeType();
DocumentEntry newDocument = new DocumentEntry();
newDocument.setFile(file, mimeType);
newDocument.setTitle(new PlainTextConstruct(file.getName()));
DocumentListEntry uploaded = service.insert(documentListFeedUrl, 
newDocument);

Please help me to resolve this issue.

Thanks,
Megha

Original issue reported on code.google.com by meghasal...@gmail.com on 11 May 2010 at 10:40

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant