Thanks Eric. this worked perfectly.

Although, what I don't understand is why this used to work perfectly
before and then all of a sudden it stopped working.  Why would it
reject a content type that includes charset:UTF8?

Michael

On Jul 28, 12:37 am, "Eric (Google)" <api.e...@google.com> wrote:
> This isn't an issue.  It seems that
> charset:UTF8 is being appended onto
> the content type when using xmlHttpRequests.
> My solution was to use a mime multipart
> request that creates a new spreadsheet
> entry from Atom XML and upload text/csv
> content at the same time.
>
> I've posted a tip that should help with 
> that:http://gdatatips.blogspot.com/2009/07/create-new-google-docs-spreadsh...
>
> Eric
>
> On Jul 27, 2:46 am, cgrizz <cartergre...@gmail.com> wrote:
>
>
>
> > i feel this issue is getting a little ignored.  did somebody find a
> > solution to this.  im still having a problem uploading any type of
> > format of text.  I'd really like to see a fix to this issue soon!
>
> > On Jul 24, 3:30 pm, cgrizz <cartergre...@gmail.com> wrote:
>
> > > i just tried to do it with a simple txt file and i also got the 415
> > > error.  im making my post in javscript.
>
> > > On Jul 23, 1:42 pm, Spanishgringo <freeman...@gmail.com> wrote:
>
> > > > Yes.  I have tried various MIME types that are all "officially"
> > > > supported
>
> > > > I still get the same415error.
>
> > > > On Jul 22, 8:40 pm, Eric Bidelman <api.e...@google.com> wrote:
>
> > > > > Have you tried 
> > > > > 'text/csv'?http://code.google.com/apis/documents/faq.html#WhatKindOfFilesCanIUpload
>
> > > > > <http://code.google.com/apis/documents/faq.html#WhatKindOfFilesCanIUpload>
> > > > > Eric
>
> > > > > On Wed, Jul 22, 2009 at 1:23 AM, Spanishgringo <freeman...@gmail.com> 
> > > > > wrote:
>
> > > > > > At this point in the script I have obtained a valid Auth token using
> > > > > > the Client Login process and I am passing a valid string that is of
> > > > > > type "text/tab-separated-values"
>
> > > > > > If you need to see other code please let me know.
>
> > > > > > Thanks for the help
>
> > > > > > function upload2GDocs(authToken, content){
> > > > > >    //function used to upload the content to GDocs
>
> > > > > > /* I have tried with and without the ?v=2 parameter */
> > > > > >    var gdocURL = 'http://docs.google.com/feeds/documents/private/
> > > > > > full';
>
> > > > > >    //unsafeWindow.console.log(content);
>
> > > > > >        authToken = authToken.toString();
> > > > > >    if (authToken.length > 1) {
> > > > > >        GM_xmlhttpRequest({
> > > > > >            method: 'POST',
> > > > > >            url: gdocURL,
> > > > > >                        overrideMimeType: 
> > > > > > "text/tab-separated-values",
> > > > > >            headers: {
> > > > > >                                'Authorization': 'GoogleLogin ' + 
> > > > > > authToken,
> > > > > >                        'Content-Length': content.length,
> > > > > >                                //'Content-Type': 'text/csv',
> > > > > >                'Content-Type': 'text/tab-separated-values',
> > > > > >                'Slug': download_report_ref+'.csv'
>
> > > > > >            },
> > > > > >            data: content,
> > > > > >            onreadystatechange: function(responseDetails){
>
> > > > > >  //unsafeWindow.console.log(responseDetails.readyState);
> > > > > >            },
> > > > > >            onload: function(responseDetails){
> > > > > >                        
> > > > > > unsafeWindow.console.log(responseDetails.status + ':
> > > > > > '+
> > > > > > responseDetails.statusText);
>
> > > > > >  //unsafeWindow.console.log(responseDetails.responseHeaders);
>
> > > > > >  unsafeWindow.console.log(responseDetails.responseText);
> > > > > >                //wait till the file is downloaded, and execute this
> > > > > > when ready
> > > > > >                if (responseDetails.status == 201) {
> > > > > >                    var ans = confirm('Successfully uploaded to 
> > > > > > Google
> > > > > > Docs \nFilename: ' + download_report_ref + '\n\n Click OK to open
> > > > > > Google Docs in a new tab \n\n(you must allow popups 
> > > > > > fromwww.google.com
> > > > > > )');
> > > > > >                    if (ans) {
> > > > > >                        window.open("http://docs.google.com/#all";,
> > > > > > 'external');
> > > > > >                    }
>
> > > > > >                }
> > > > > >                else {
> > > > > >                    //unsafeWindow.console.log
> > > > > > (responseDetails.responseHeaders);
> > > > > >                    //unsafeWindow.console.log
> > > > > > (responseDetails.responseText);
> > > > > >                    if (responseDetails.status == 400) {
> > > > > >                        retryLessWin(responseDetails);
> > > > > >                    }
> > > > > >                    else {
> > > > > >                        alert('Whoops! There was a problem \n\n
> > > > > > Error: ' + responseDetails.status + ': ' +
> > > > > > responseDetails.statusText);
> > > > > >                    };
> > > > > >                                    };
>
> > > > > >                showLoad(false);
> > > > > >            },
> > > > > >            onerror: function(responseDetails){
> > > > > >                alert('There seems to be a problem connecting...\n' +
> > > > > > responseDetails.status + ': ' + responseDetails.statusText);
> > > > > >                showLoad(false);
> > > > > >            }
>
> > > > > >        });
>
> > > > > >    }
>
> > > > > > }
>
> > > > > > On Jul 17, 7:45 pm, Eric Bidelman <api.e...@google.com> wrote:
> > > > > > > Can I see the code?
>
> > > > > > > On Fri, Jul 17, 2009 at 4:13 AM, Spanishgringo 
> > > > > > > <freeman...@gmail.com>
> > > > > > wrote:
>
> > > > > > > > I have a script that I have been using for the last year to 
> > > > > > > > export
> > > > > > > > reports directly from Google Analytics to Google Docs & 
> > > > > > > > Spreadsheets.
>
> > > > > > > > Something seems to have changed on the Google Docs Data List 
> > > > > > > > API side
> > > > > > > > where I always get a415error.  I am using Greasemonkey with
> > > > > > > > ClientLogin Auth and xmlhttpRequest to submit the downloaded 
> > > > > > > > csv or
> > > > > > > > tsv file.
>
> > > > > > > > The response text with the415error is:
>
> > > > > > > > Content-Type text/csv;charset=utf-8 is not a valid input type.
>
> > > > > > > > Any ideas?
>
> > > > > > > > Please help.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to