prayagverma / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
1 stars 0 forks source link

gdata.docs request: GetFormUploadToken #593

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. This is not a problem, this is a Feature Request.

What version of the product are you using?
gdata-2.0.16

Please provide any additional information below.

There's a really neat function in gdata.youtube.service named 
"GetFormUploadToken" which allows an end user to POST file metadata to a 
handler, which the handler uses to create an upload session w/ the YouTube 
feed. The feed returns a tuple of (post_url, youtube_token), which the handler 
returns to the user (JavaScript -> hidden input field). This allows the user to 
then POST the file content (video data) directly to the YouTube feed, instead 
of to the upload handler.

I think that makes total sense for YouTube videos (high bandwidth). I'd love to 
see something similar in gdata.docs!  I'm developing on Google App Engine, and 
because GAE has a HTTP size limit of 32 MB, large file upload (POST/PUT) time 
out. If this feature were available then the file upload data (content) 
wouldn't have to pass through the handler, only the metadata would, and so the 
32MB limit wouldn't come into play. It seems like this would be an efficient 
way to deal with large files from an end user perspective as well.

Thank you for reading!

Ashwini

Original issue reported on code.google.com by r...@majestik.net on 6 Feb 2012 at 8:53

GoogleCodeExporter commented 9 years ago
Hi thanks for this, but there is already a solution. For docs you should use 
resumable upload to break up your file into chunks. This would solve the file 
size limit issue.

Original comment by afs...@google.com on 13 Feb 2012 at 3:31

GoogleCodeExporter commented 9 years ago
Hi Ali,

Now its possible that i'm missing something (it's certainly happened before), 
but I don't believe GDocs resumable uploader is a solution, here's why: 

1)  It requires the file content to live on GAE/server side, versus being 
POSTed directly by the user as with the YouTube function. The content is not 
server side. 

2)  The user has no authentication to POST directly to the feed. The OAuth 
secret/pass do not live in user land, they are server side, so the user can't 
authenticate to the feed. The YouTube function gets around this issue w/ the 
temporary auth token.

3)  The user (w/ JS) wouldn't be able to receive or send the resumable upload 
chunk/status headers from the GDocs feed. No 201 etc. If that data could be 
transmitted in user-level JSON or something then I could see it working....

Honestly, I hope that I'm completely wrong about all this and that you have a 
simple solution, with some code preferably. That would rock.

Like I said I've certainly been wrong before ;)

Thanks 

Ashwini

Original comment by r...@majestik.net on 13 Feb 2012 at 5:01

GoogleCodeExporter commented 9 years ago
Thanks for the detailed info Ashwini. You are correct, but the API won't 
provide this functionality. You can already upload the data directly to Google 
Docs as a user, but of course that won't be in your application.

I do believe that the problem is effectively solved with resumable upload, but 
of course you will have to receive the data first, then send it later. The only 
issue solved by resumable upload is the file size issue.

Original comment by afs...@google.com on 13 Feb 2012 at 5:48

GoogleCodeExporter commented 9 years ago
Ah! 

"The API won't provide this functionality" is what I was looking for. 

I guess requesting a client library update for an API that doesn't exist is 
putting the buggy before the horse :)  If there was a place I could post API 
feature requests I guess that's where I'd have to start.

Thanks for your help Ali.

Ashwini

Original comment by r...@majestik.net on 13 Feb 2012 at 10:33