-2

I need to file name and file path when i select a file for upload with a file object in form. It can be use with javascript or jquery i think because i need to use it on browser.

I tried this ways This is my file object id and name : Upload1

$("#Upload1").val();
$('#Upload1').attr("value");
document.getElementById("Upload1").files[0].name;
this.Upload1.value;

It returns "C:\fakepath\example.gdb" or "example.gdb"

but i need to original path of file. and it should not be temporary file and path for example : $_FILES["Upload1"]["tmp_name"]

Please help... Thanks.

  • 1
    Why exactly do you need the file path? There isn't a whole lot you could do with it. The browser doesn't allow access to this information. – Kevin B Jul 08 '13 at 14:34

1 Answers1

0

No, you can't get file path - refer to w3 language reference

The input element with a type attribute whose value is "file" represents a list of file items, each consisting of a file name, a file type, and a file body (the contents of the file)

http://www.w3.org/TR/html-markup/input.file.html

Mohammad Adil
  • 43,337
  • 17
  • 86
  • 109