I've figured out the problem. For some reason, when I put the form
into the html, one of the fields changes to <input id="file"
type="file" $p.name="file">, where name is replaced by $p.name
I manually changed it in firebug and managed to upload a test video!
This seems like an html problem, not one with Youtube API.
Thanks,
Bo
On Jan 9, 12:13 pm, Jeffrey Posnick <je...@google.com> wrote:
> Hello Bo,
>
> I'm sorry, but I really would need to see this in action on a web
> site that I could access in order to debug further. Could you upload
> your code to a production server?
>
> Cheers,
> -Jeff Posnick, YouTube API Team
> groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> @YouTubeDev
>
> On Jan 7, 3:32 pm, Bo Han <bo.ning....@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Jeff,
>
> > I'm running it on a local machine. I've provided as much info as I can
> > below.
>
> > I think I'm getting the upload url and token correctly. An example of
> > the url is this 195 character string: "http://
> > uploads.gdata.youtube.com/action/FormDataUpload/AIwbFARGE0HraU7Y86GwMS-
> > b4geNbunf67cIDSyc32FRBDoHxVPh4fhTiTj943g3WUmzzj5HkkZTu_k3KUB-0XLuoL9s9wA0Jh XPkBOT55EnpwFEAS5FFk-
> > QmX5uUHy5Gh_8N0D2uETu". An example of a token I get is this 418
> > character string:
> > "AIwbFAQLpHCp0W1f0n9W2BntBOtSLcH4IPj_EV9A0zwu4p1fKoRsz57QMUekGfVmAdwKfL7sAC P2OYTiTK5HWKdV77-
> > y3zPy7Ixc03uK2RwRCeIvurJxYLC60w7Op4KaIYD4UCwdCW35IdrROGtRe-
> > YgK6qrLHl2wjSvBe4e-ePUd3mLnRUxWbvt-
> > OqH3g1IrYVrLaMNJyJUsLsQ0QCxUpwitGTq8Di-7r3Zm3quuFPuLLzpnpu7bSqwjNL1JRquPvte YXrql8Hh7GGT51x6mjR-
> > nfmL4i-
> > CZyZ3Gg9q76prHukDv6CdShRbLpR07UEWuiPFc7LdgfGBTsV2TwCUrZBjABnZqcviWiDCdXXdvi IQgyYE1X5EPFRidb5Q5FH8ejPXQfD7oULyRRpO2oY5zaW5-6NULaVjcg".
>
> > I give these two parameters to this function:
>
> > function submitVideo(url, token) {
> > var form = '<form action=\''+url+'?nexturl=google.com\' method=POST
> > \
> > enctype="multipart/form-data" onsubmit="return true;"> \
> > <input id="file" type="file" name="file"/> \
> > <div id="errMsg" style="display:none;color:red"> </div> \
> > <input type="hidden" name="token" value=\"'+token+'\"/> \
> > <input type="submit" value="go" /> \
> > </form>';
> > $.prompt(form, {
> > buttons: {}
> > });
>
> > }
>
> > The $.prompt is from a jQuery extension for easy form submission from
> > a pop up:http://trentrichardson.com/Impromptu/
>
> > Thanks!
> > Bo
>
> > On Jan 6, 4:41 pm, Jeffrey Posnick <je...@google.com> wrote:
>
> > > Hello Bo,
>
> > > I'm not sure what the issue is just from looking at that HTML. Is
> > > there a test page that's publicly accessible where I can reproduce the
> > > problem for myself?
>
> > > Cheers,
> > > -Jeff Posnick, YouTube API Team
> > > groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> > > @YouTubeDev
>
> > > On Jan 5, 9:36 pm, Bo Han <bo.ning....@gmail.com> wrote:
>
> > > > Hi Jeffrey,
>
> > > > Thanks!
> > > > I managed to do that part through Node.js. Now I have an upload URL and
> > > > token.
>
> > > > But I'm having trouble actually uploading the video. I display a form to
> > > > the user according to the documentation. I then try to upload a small .mp4
> > > > video file, but I get Invalid Request every time.
>
> > > > This is what the form looks like. I've substituted in default values of
> > > > google.com for nexturl, true for onsubmit and nothing for errMsg because
> > > > I'm just trying to get it to work.
>
> > > > <form action=\'+url+'?nexturl=google.com\' method=POST
> > > > enctype="multipart/form-data" onsubmit="return true;">
> > > > <input id="file" type="file" name="file"/>
> > > > <div id="errMsg" style="display:none;color:red"></div>
> > > > <input type="hidden" name="token" value=\"'+token+'\"/>
> > > > <input type="submit" value="go" />
> > > > </form>
--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
No comments:
Post a Comment