如何使用SQL Server 2005在ASP.NET中上传视频
问题描述:
请告诉我我如何使用带有C#的Asp.net在Sql服务器数据库中上传或保存视频.></b>
please tell me how i upload or save a video in Sql-server database using Asp.net with C#.<b></b>
答
也许此 [
Maybe this[^] can help you get started.
尝试此链接
如何从asp.net c#应用程序上传视频 [
try this link
How to Upload Videos from asp.net c# Application[^]
在保存"按钮后面的代码中
------------------------------------
In Code Behind Save Button
------------------------------------
if (flup_Video_Path.HasFile)
{
string fileName_Vdo = Path.GetFileNameWithoutExtension(Guid.NewGuid().ToString() + "_" + flup_Video_Path.FileName).ToString() + Path.GetExtension(flup_Video_Path.FileName).ToString();
flup_Video_Path.SaveAs(Server.MapPath("~/Uploads/video/") + fileName_Vdo);
bind.Video_Path = fileName_Vdo;
}
------------------------------------------------
在aspx页面中
------------------
------------------------------------------------
In aspx Page
------------------
<dl><dt><label>Video</label></dt>
<dd><asp:FileUpload runat="server" ID="flup_Video_Path" ></asp:FileUpload></dd>
</dl>
-------------------------------------------------- -
------------------------------------
在SQL表中创建此字段
---------------------------------
Video_Path nvarchar(200)
----------------------------------------------------
------------------------------------
In SQL Table Create this field
---------------------------------
Video_Path nvarchar(200)