lopnor / Net-Google-DocumentsList

http://search.cpan.org/dist/Net-Google-DocumentsList/
3 stars 0 forks source link

Problem converting MSWord docs #1

Open barefootcoder opened 12 years ago

barefootcoder commented 12 years ago

Okay, I'm using code like so:

$self->_doclist->add_item({ title => $name, file => $file  })

where obviously $self->_doclist is a Net::Google::DocumentsList. Very simple. Now, if $file is a text document, or a PDF, this works fine. But if it's a Word doc, it fails. Here's the error I get:

call died with: request for 'https://docs.google.com/feeds/upload/create-session/default/private/full?upload_id=AEnB2UoUIo-pofTzW_axutk03wJeTNGNlmlWvSN_02vJvlj5ArhIcdN4GPlXV-FEiV-KqOiT3NF4nxPJpenrluA-dYED1wtZSg' failed:
        400 Bad Request
        <errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidEntryException</code><internalReason>We're sorry, a server error occurred. Please try again.</internalReason></error></errors>
         at /home/buddy/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/Net/Google/DataAPI/Role/Service.pm line 96
        Net::Google::DataAPI::Role::Service::request('Net::Google::DocumentsList=HASH(0x421e0d8)', 'HTTP::Request=HASH(0x440de70)') called at /home/buddy/common/perl/Net/Google/DocumentsList/Role/HasItems.pm line 104
        Class::MOP::Class:::around('CODE(0x4013db8)', 'Net::Google::DocumentsList=HASH(0x421e0d8)', 'HASH(0x34e90b8)') called at /home/buddy/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux/Class/MOP/Method/Wrapped.pm line 162
        Class::MOP::Method::Wrapped::__ANON__('Net::Google::DocumentsList=HASH(0x421e0d8)', 'HASH(0x34e90b8)') called at /home/buddy/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/x86_64-linux/Class/MOP/Method/Wrapped.pm line 91
        Net::Google::DocumentsList::add_item('Net::Google::DocumentsList=HASH(0x421e0d8)', 'HASH(0x34e90b8)') called at /home/buddy/common/perl/myperl/Google.pm line 50
        Google::Service::upload_doc('Google::Service=HASH(0x3413110)', 'IO::Prompt::ReturnVal=HASH(0x34f1d68)') called at /home/buddy/bin/hire line 98
        Resume::upload('Resume', 'IO::Prompt::ReturnVal=HASH(0x34f1d68)') called at /home/buddy/bin/hire line 411
        main::upload_resume() called at /home/buddy/bin/hire line 348
        eval {...} called at /home/buddy/bin/hire line 347
        main::dispatch('CODE(0x414a848)') called at /home/buddy/bin/hire line 471
        main::menu('HASH(0x34f2ad0)') called at /home/buddy/bin/hire line 472
        main::menu('HASH(0x34f2968)') called at /home/buddy/bin/hire line 327

If I try to upload the same file(s) manually, it works. Am I doing something wrong here?

lopnor commented 12 years ago

Will you tell me how to reproduce? It worked fine from my box.

barefootcoder commented 12 years ago

Hmmm ... it's very consistent for me. Both .doc and .docx files fail in my script, but work file when I upload them manually. I was wondering if maybe I wasn't setting some conversion flag or something ... can you send me a test .doc file and a script and let me try to upload those? I'll also try my test uploads again, just in case it was a transient error on Google's side.

Thanx for looking into it.

lopnor commented 12 years ago

added test and docs.

8baeebf7310dc239e7f3b991e8f9887b6278fa59

you can run the test with (the test requires some CPAN modules and configurations)

NET_GOOGLE_DOCUMENTSLIST_LIVE_TEST=1 prove -lv t/06_upload.t