如何从客户端PC获取上传文件的完整路径? [英] How can i get the full path of my upload file from Client PC?

查看:200
本文介绍了如何从客户端PC获取上传文件的完整路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我的客户在D:\Document\Files \ my Report.doc中有一个1个文件

i想得到此文件的路径并插入一个列表。但我不知道该怎么做。我尝试使用fileupload1.filename,PostedFile.FileName,Server.MapPath(fileupload1.FileName),

Server.MapPath(〜/)+ cmdupload.FileName。但他们都错了。

因为他们只得到文件名(我的报告.doc)。



我的原因想要获取此文件的路径,因为此文件不会上传到Web服务器,但会上传到其他数据库服务器附件文件(SAP附件文件)。



有谁知道如何通过使用fileupload来获取这个文件的全部内容(D:\Document\Files)?



谢谢



TONY

解决方案

仅获取文件名

 fileupload1 .FileName 



获取带有完整选定路径的文件名

 fileupload1.PostedFile.FileName 


Hi all experts,
My client has one 1 file in "D:\Document\Files\my Report.doc"
i want to get the path of this file and insert to one list. but i don''t know how to do this. i try to user fileupload1.filename,PostedFile.FileName,Server.MapPath(fileupload1.FileName),
Server.MapPath("~/") + cmdupload.FileName. But they all are wrong.
coz they just get only file name ("My report.doc").

The reason that i want to get the path of this file because this file will not upload to web server but it will upload to other database server attachment file (SAP Attachment file).

Does anybody know how i can get the full of this file ("D:\Document\Files") by using fileupload?

Thanks

TONY

解决方案

To get the filename only

fileupload1.FileName


To get the filename with complete selected path

fileupload1.PostedFile.FileName


这篇关于如何从客户端PC获取上传文件的完整路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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