将文件路径保存到数据库 [英] Saving the filepath to the database
本文介绍了将文件路径保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
任何人都可以教我如何将文件名添加到server.mapPath,以便它显示如下路径:
D:\DB\DatabaseA\Upload\Cmpt \FileName
例如: D:\DB\DatabaseA\Upload \\ \\ Cmpt\BankStatement
这是我目前的代码:
hello,
can anyone teach me how to add the filename to server.mapPath so that it will show path like:
D:\DB\DatabaseA\Upload\Cmpt\FileName
example: D:\DB\DatabaseA\Upload\Cmpt\BankStatement
here is my current code:
Dim path As String = Server.MapPath("Upload/Cmpt/")
Dim tFileName As String = e.UploadedFile.FileName
推荐答案
string cont_name = "";
cont_name = fileuploadcontrol1.FileName;
string path = Server.MapPath("uploads/");
fileuploadcontrol1.SaveAs(path + cont_name);
string FullPath = "uploads/" + cont_name;
这篇关于将文件路径保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文