【问题标题】:what is the maximum video size we can upload to youtube using asp.net website我们可以使用 asp.net 网站上传到 youtube 的最大视频大小是多少
【发布时间】:2014-04-10 16:48:06
【问题描述】:

您好,我正在使用基于浏览器的上传通过我的 asp.net 网站将视频上传到 youtube。

YouTubeService service = new YouTubeService("MyAppName", devkey);
YouTubeRequestSettings objSettings = new YouTubeRequestSettings("eBizLink", devkey, username, password);
objSettings.Timeout = 999999990;
objSettings.Maximum = 2000000000;
YouTubeRequest objRequest = new YouTubeRequest(objSettings);
((GDataRequestFactory)objRequest.Service.RequestFactory).Timeout = 9999999;
((GDataRequestFactory)service.RequestFactory).KeepAlive = false;
objRequest.Settings.Timeout = 9999999;//60 * 60 * 1000

//objSettings.Timeout = 10000000;
//objSettings.Maximum = 2000000000;
Video objNewVideo = new Video();
//objNewVideo.Title = txtTitle.Text.Trim();
objNewVideo.Title = ViewState["VideoName"].ToString();
objNewVideo.Tags.Add(new MediaCategory("Animals", YouTubeNameTable.CategorySchema));
objNewVideo.Keywords = txtKeyWrd.Text.Trim();
objNewVideo.Description = txtDescription.Text.Trim();
objNewVideo.YouTubeEntry.Private = false;
objNewVideo.YouTubeEntry.AccessControls.Add(new YtAccessControl("list", "denied"));

//objNewVideo.YouTubeEntry.State.Name="restricted";
//objNewVideo.YouTubeEntry.State.Reason = "Must login";
objNewVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema));
objNewVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
objNewVideo.YouTubeEntry.MediaSource = new MediaFileSource(FilePath, "video/mp4");
Video createdVideo = objRequest.Upload(objNewVideo);

Web.config:

<httpRuntime executionTimeout="24000" maxRequestLength="4124672" requestValidationMode="4.5"/>
<requestFiltering>
    <requestLimits maxAllowedContentLength="2147483648"/>
</requestFiltering>

这是接受最大 100MB,但我想上传 2GB 的视频。

我的查询:
我需要对上面的代码做一些更改吗

我需要对帐户设置进行一些更改吗?

【问题讨论】:

    标签: c# asp.net youtube


    【解决方案1】:

    从 YouTube 网页上传的文件大小限制为 2 GB,如果使用最新的浏览器版本,则限制为 20 GB

    http://en.wikipedia.org/wiki/YouTube#Uploading

    【讨论】:

      【解决方案2】:

      试试这个

      <system.webServer>
         <security>
           <requestFiltering>
             <requestLimits maxAllowedContentLength="1073741824"/>
           </requestFiltering>
         </security>
      </system.webServer>
      

      这适用于 1GB。随意增加maxAllowedContentLength。

      【讨论】:

      • 嗨梅尔科尔!!我已经尝试过了,但它甚至没有上传 350MB 的视频。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-22
      • 2015-05-16
      • 2017-09-16
      • 1970-01-01
      • 2012-02-26
      • 2014-05-09
      • 1970-01-01
      相关资源
      最近更新 更多