FileUploadField gives file path in IE, but only file name in Chrome and Firefox

  1. #1

    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:
    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"));
                            }
  2. #2
    Geoffrey McGill
    Founder

Similar Threads

  1. Upload file with file path
    By yash.kapoor in forum 2.x Help
    Replies: 4
    Last Post: Nov 02, 2012, 11:15 AM
  2. Replies: 6
    Last Post: Jan 11, 2012, 9:52 AM
  3. Replies: 0
    Last Post: Nov 04, 2010, 7:09 PM
  4. File Path for in Extention Project
    By bsnezw in forum 1.x Help
    Replies: 3
    Last Post: Sep 21, 2009, 5:38 PM
  5. FileUploadField file name
    By Kamal in forum 1.x Help
    Replies: 2
    Last Post: Jun 29, 2009, 1:01 PM

Tags for this Thread

Posting Permissions