回发后保存FileUpload Control的路径

时间:2012-05-31 07:58:01

标签: asp.net

我想在FileUpload asp.net控件中回发后保存路径到文件:

function GetPathToDownloadPictures() {
    var pathToDownLoadPicture = document.getElementById('<%= UploadPicturesNews.ClientID %>').value;
    document.getElementById('<%= PathToPicturesHidden.ClientID %>').value = pathToDownLoadPicture;
}

window.document.onload = AddPathToUploadControl();

function AddPathToUploadControl() {
    var pathToDownLoadPicture = document.getElementById('<%= PathToPicturesHidden.ClientID %>').value;
    document.getElementById('<%= UploadPicturesNews.ClientID %>').value = pathToDownLoadPicture;
}

将文件从FileUpload添加到HiddenField,并在回发后将路径从HiddenField添加到FileUpload,但不能正常工作.... 帮帮我

1 个答案:

答案 0 :(得分:0)

现代浏览器中原始文件路径不再可用,因为此信息被视为存在安全风险。

根据浏览器的不同,您不会收到任何路径信息,也不会在IE上收到c:\fakepath