关于视频上传的问题 大虾帮忙

qpf04140133 2008-07-05 10:03:47
小弟想实现视频上传的一个功能
具体代码如下:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using Xiaoxiao.Upload;
using System.IO;
using Spaces;
using Spaces.Controls;
using Spaces.Video;


public partial class Admin_UploadVideo : AdminPage
{
protected void Page_Load(object sender, EventArgs e)
{
videoBtn.Click += new EventHandler(videoBtn_Click);
if (!IsPostBack)
{
InitData();
}
}
void InitData()
{
UploadHelper uploadHelper = new UploadHelper();
uploadHelper.RegisterProgressBar(videoBtn, false, 1024*1024*50, ".asx,.asf,.mov,.wmv,.avi,.mpeg,.mpg,.flv,.3gp,.mp4");


}
void videoBtn_Click(object sender, EventArgs e)
{
Video v = new Video();
v.SourceType = (SourceType)int.Parse(rbtnSource.SelectedValue);

v.ServerID = VideoConfig.GetVideoConfig().DefaultServer.ServerID;
v.Title = txtName.Text;
v.Tags = Utils.GetTags(txtTags.Text);
v.Content = txtDesc.Text;
v.Account = this.Account;



UploadFile uploadFile = UploadHelper.GetUploadFile("file1");
if (uploadFile == null)
{
Message = "错误的格式";
return;
}
v.Extension = Path.GetExtension(uploadFile.FileName);
string savePath=Server.MapPath(string.Format("{0}/video/temp",Globals.ApplicationPath));
string saveName = string.Format("{0}{1}{2}", this.Account,DateTime.Now.ToFileTime(),v.Extension);
if (!CheckExt(v.Extension))//检查后缀名
{

Message = "您所上传的格式不支持";
return;
}
v.InputFile = Path.Combine(savePath,saveName);
uploadFile.SaveAs(v.InputFile);

Videos.CreateVideo(v);

Response.Redirect("myVideo.aspx");

}

bool CheckExt(string ext)
{
bool chk = false;
switch (ext.ToLower())
{
case ".wmv":
chk = true;
break;
case ".mp4":
chk = true;
break;
case ".3gp":
chk = true;
break;
case ".avi":
chk = true;
break;
case ".flv":
chk = true;
break;
case ".mpg":
chk = true;
break;
case ".mpeg":
chk = true;
break;
case ".asf":
chk = true;
break;
case ".mov":
chk = true;
break;
case ".asx":
chk = true;
break;

}
return chk;
}
}


出错页面如下:
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

系统找不到指定的文件。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.ComponentModel.Win32Exception: 系统找不到指定的文件。

源错误:


行 65: uploadFile.SaveAs(v.InputFile);
行 66:
行 67: Videos.CreateVideo(v);
行 68:
行 69: Response.Redirect("myVideo.aspx");


源文件: e:\web sites\BLOG SYSTEM\qiupengfeng-blog\Admin\UploadVideo.aspx.cs 行: 67

堆栈跟踪:


[Win32Exception (0x80004005): 系统找不到指定的文件。]
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +976
System.Diagnostics.Process.Start() +127
System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +50
Spaces.Video.FFMpeg.MakePic() +102
Spaces.Video.Videos.CreateVideo(Video v) +372
Admin_UploadVideo.videoBtn_Click(Object sender, EventArgs e) in e:\web sites\BLOG SYSTEM\qiupengfeng-blog\Admin\UploadVideo.aspx.cs:67
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.1433; ASP.NET 版本:2.0.50727.1433

各位帮忙看下 谢了
...全文
82 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
dony_feng 2008-07-05
  • 打赏
  • 举报
回复
关注
luofuxian 2008-07-05
  • 打赏
  • 举报
回复
定下

62,133

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧