Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google gadget and sites api

I'm writing a google gadget (nothing but plain html + javascript) to upload a file onto a private google site using the sites api. http://code.google.com/apis/sites/docs/1.0/developers_guide_protocol.html#UploadingFiles

I can only upload the file using a multi-part form. But it doesn't work because the api needs oauth authentication. Authetication involves setting some header fields in the POST request. Unfortunately form submit does not let us set the header, thus no authentication. I can't make an ajax call because of cross-domain restrictions. Any ideas on what can be done?

One way I can think of is to use a proxy which makes the authenticated call, but I want to avoid that. I need a javascript-only way of doing it.

like image 855
akula1001 Avatar asked Jan 06 '10 06:01

akula1001


1 Answers

post to a server side script and initiate a curl request with all the headers you want?

like image 171
Dave Mackintosh Avatar answered Oct 03 '22 15:10

Dave Mackintosh