Dec 05, 2012, 8:31 PM
FileUploadField gives file path in IE, but only file name in Chrome and Firefox
When I am using IE, the following code prints out "C:/Users/Documents/.../myFile.xlsx"
However when I use Chrome or Firefox, it prints "myFile.xlsx".
Why is this, and how can I get the whole path for every browser?
Controller:
However when I use Chrome or Firefox, it prints "myFile.xlsx".
Why is this, and how can I get the whole path for every browser?
Controller:
public ActionResult UploadSpreadsheet()
{
var fileName = Request.Files[0].FileName;
Debug.WriteLine(fileName);
}
View: ...FormPanel()
.Url("/Home/UploadSpreadsheet")
.Items(items =>
{
items.Add(Html.X().DisplayField()
.Text("Choose the file you would like to upload:"));
items.Add(Html.X().FileUploadField()
.ID("FileUploadField"));
}