如何在数据库和视频文件夹中保存视频路径以及如何从数据库中检索视频 [英] how to save the path of video in database and video in folder and how retrieve the video from database

查看:99
本文介绍了如何在数据库和视频文件夹中保存视频路径以及如何从数据库中检索视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在数据库和视频文件夹中保存视频路径以及如何从数据库中检索视频

how to save the path of video in database and video in folder and how retrieve the video from database

推荐答案

同样的问题在这里讨论 [ ^ ]


如何在数据库和视频文件夹中保存视频路径以及如何从数据库中检索视频
how to save the path of video in database and video in folder and how retrieve the video from database


[aspx页面编码]



< asp:label id =label1runat =server> Vedio

< asp :FileUpload runat =" server" ID = flup_Video_Path"

< asp:Button id =" btn_save" RUNAT = QUOT;服务器" text =" Save">





[保存按钮编码]



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;

}

----



[在sql表中创建一个字段就像]



Video_Path nvarchar(300)



如果它请选择作为答案。
[aspx page coding]

<asp:label id="label1" runat="server">Vedio
<asp:FileUpload runat="server" ID=flup_Video_Path"
<asp:Button id="btn_save" runat="server" text="Save">


[save button coding]

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;
}
----

[create a field in sql table like]

Video_Path nvarchar(300)

if it work please select as answer.


这篇关于如何在数据库和视频文件夹中保存视频路径以及如何从数据库中检索视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆