基于浏览器的YouTube上传在Firefox 16中意外中止 [英] Browser-Based YouTube Upload in Firefox 16 Aborts Unexpectedly
问题描述
为了让事情变得更奇怪,请求在Firebug的 Net 标签中根本不被记录。在Firefox的 Web控制台 上,我可以看到请求,但响应和状态代码完全丢失。然后,如果我使用 Decrypt HTTPS流量选项使用Fiddler文件上传正确。
任何人有任何想法可能会发生什么或如何监控SSL流量而不修复问题?
<!DOCTYPE html>
< html>
< head>< title> YouTube Test< / title>< / head>
< body>
< table>
< tr>< td>< input type =filename =file/>< / td>< / tr>
< tr>< td>
< input type =hiddenname =tokenvalue =MY_YOUTUBE_TOKEN/>
< input type =submitvalue =上传/>
< / td>< / tr>
< / table>
< / form>
< / body>
< / html>
YouTube的网址和令牌是在后台使用ASP.Net与Google.GData.YouTube图书馆。这是这段代码的一部分:
public class BaseModel
{
public string SITE_YOUTUBE_APP_NAME =;
public string SITE_YOUTUBE_DEV_KEY =;
public string SITE_YOUTUBE_USERNAME =;
public string SITE_YOUTUBE_PASSWORD =;
public string YOUTUBE_CATEGORY =;
public FormUploadToken FormToken;
$ b $ public void Load()
{
YouTubeRequestSettings settings = new YouTubeRequestSettings(
SITE_YOUTUBE_APP_NAME,SITE_YOUTUBE_DEV_KEY,
SITE_YOUTUBE_USERNAME,SITE_YOUTUBE_PASSWORD);
YouTubeRequest请求=新的YouTubeRequest(设置);
Video newVideo = new Video();
string title =测试标题;
string description =测试说明;
newVideo.Title = title;
newVideo.Tags.Add(new MediaCategory(YOUTUBE_CATEGORY,YouTubeNameTable.CategorySchema));
newVideo.Keywords =test;
newVideo.Description = description;
newVideo.YouTubeEntry.Private = false;
FormToken = request.CreateFormUploadToken(newVideo);
$ / code $ / pre
解决方案现在Firefox 17已经上市了,谷歌并没有完全支持Firefox 16的这个功能,我给Firefox 16的用户添加了一个警告,以升级到Firefox 17或者使用不同的浏览器。不理想,但这是唯一合理的解决方案,因为测试用户在Firefox 16上不成功。
I have a regular YouTube browser-based upload form, as shown below. It works great in IE, Chrome, and older versions of Firefox. However, my Firefox 16.0.2, just hangs on the POST. I have replicated the problem on other computers with Firefox 16.x.
The file uploads correctly if I manually override the SSL by changing YouTube's URL from: https://uploads.gdata.youtube.com to http://uploads.gdata.youtube.com.
To make things even stranger, the request is not logged at all on the Net tab in Firebug. On Firefox's Web Console, I can see the request, but the response and status code is totally missing. Then, if I use Fiddler with the Decrypt HTTPS traffic option enabled the file uploads correctly.
Anyone have any ideas what could be going on or how to monitor the SSL traffic without fixing the problem?
<!DOCTYPE html>
<html>
<head><title>YouTube Test</title></head>
<body>
<form id="frmYouTube" enctype="multipart/form-data" method="post" action="https://uploads.gdata.youtube.com/action/FormDataUpload/YOU_TUBE_URL?nexturl=https%3a%2f%2fMY.DOMAIN.COM%2fDIR_1%2fDIR_2%3fid2%3dLOCAL_ID">
<table>
<tr><td><input type="file" name="file" /></td></tr>
<tr><td>
<input type="hidden" name="token" value="MY_YOUTUBE_TOKEN" />
<input type="submit" value="Upload" />
</td></tr>
</table>
</form>
</body>
</html>
The YouTube url and token are generated on the backend using ASP.Net with the Google.GData.YouTube library. Here is part of that code:
public class BaseModel
{
public string SITE_YOUTUBE_APP_NAME = "";
public string SITE_YOUTUBE_DEV_KEY = "";
public string SITE_YOUTUBE_USERNAME = "";
public string SITE_YOUTUBE_PASSWORD = "";
public string YOUTUBE_CATEGORY = "";
public FormUploadToken FormToken;
public void Load()
{
YouTubeRequestSettings settings = new YouTubeRequestSettings(
SITE_YOUTUBE_APP_NAME, SITE_YOUTUBE_DEV_KEY,
SITE_YOUTUBE_USERNAME, SITE_YOUTUBE_PASSWORD);
YouTubeRequest request = new YouTubeRequest(settings);
Video newVideo = new Video();
string title = "Test Title";
string description = "Test Description";
newVideo.Title = title;
newVideo.Tags.Add(new MediaCategory(YOUTUBE_CATEGORY, YouTubeNameTable.CategorySchema));
newVideo.Keywords = "test";
newVideo.Description = description;
newVideo.YouTubeEntry.Private = false;
FormToken = request.CreateFormUploadToken(newVideo);
}
}
解决方案 Since Firefox 17 is now available and Google does not completely support Firefox 16 for this feature, I added a warning for users with Firefox 16 to upgrade to Firefox 17 or use a different browser. Not ideal, but this was the only reasonable solution given the number of test users who were unsuccessful on Firefox 16.
这篇关于基于浏览器的YouTube上传在Firefox 16中意外中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!