路径使用文件上传控件

路径使用文件上传控件

问题描述:

我的aspx页面上有一个fileuploader(< asp:FileUpload ID =FileUpload1runat =server/>)控件。在按钮单击我想要我的文件的物理完整路径,我将在服务器上上传。如果文件在桌面上,那么它应该显示C:\Documents and Settings \Administrator \Desktop\Book1.xlsx

I am having a fileuploader(<asp:FileUpload ID="FileUpload1" runat="server" />) control on my aspx page. On button click i want the physical fullpath of my file, which i am going to upload on server. If the file is in desktop then it should show C:\Documents and Settings\Administrator\Desktop\Book1.xlsx

>
试试这个



Hi,
try this

string filePath = Path.GetFullPath(FileUpload1.FileName);;


请参考此链接并查看您的问题。

以下是以下链接:

使用fileupload控件确认文件的完整路径 [ ^ ]
Please refer this link and check out with your question.
Here is the link below.
get full path of file using fileupload control[^]


试试这个



string s1 = Path(FileUpload1.FileName);



希望这能帮到你
try this

string s1=Path(FileUpload1.FileName);

hope this will help you