Javascript 设置上载文件的路径

Javascript 设置上载文件的路径,javascript,Javascript,我是js新手,我有这样的代码,可以设置上传文件的路径: document.getElementById("binaryFilePath").value = "location" 当我运行此命令时,我得到: [Error] InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable. global code (AppAdmin,

我是js新手,我有这样的代码,可以设置上传文件的路径:

document.getElementById("binaryFilePath").value = "location"
当我运行此命令时,我得到:

[Error] InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
    global code (AppAdmin, line 1)

发生了什么事

你在找这个吗

  function myFunction()
  {
  var x = document.getElementById("myFile").type;
  document.getElementById("demo").innerHTML = x;
  }

使用fiddle url:

这将无法自行上传文件-请粘贴更多代码或链接到jsfiddle@splig:很抱歉设置上载文件的路径