為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Trusted site list or exception to bypass C:\fakepath\ for file uploads

  • 1 回覆
  • 1 有這個問題
  • 5 次檢視
  • 最近回覆由 cor-el

more options

When attempting to upload a file using [Browse] button in a form on a website, the original filepath, which may be for example:

   C:\Users\myname\photos\pic.jpg

Shows up as:

 C:\fakepath\pic.jpg

This causes the upload to fail. Apparently, this is a feature of HTML 5 "the local path to a file should not be given to any untrusted website. Instead, the browser will replace the actual path with C:\fakepath, and the upload will fail if attempted"

The key being here " UNTRUSTED WEBSITE"

In my case, yes, it is my router webpage which is using a Cisco self-signed certificate so the https:// is deemed "insecure" - and I need to choose to proceed anyway or add exception (depending on browser) to bypass the SSL warning and pull up the webpage. So yes, I'd say it's being seen as "untrusted"

Now the suggested fix is to add the website to the list of "Trusted sites" in IE-speak. How is this accomplished in current Firefox ? I found only a forum post from 2013 that said Tools->Options->Security->Exceptions. Current Firefox "privacy & security" page has 4 [Exceptions] buttons, none of which are an obvious choice in this context!

When attempting to upload a file using [Browse] button in a form on a website, the original filepath, which may be for example: C:\Users\myname\photos\pic.jpg Shows up as: C:\fakepath\pic.jpg This causes the upload to fail. Apparently, this is a feature of HTML 5 "the local path to a file should not be given to any untrusted website. Instead, the browser will replace the actual path with C:\fakepath, and the upload will fail if attempted" The key being here " UNTRUSTED WEBSITE" In my case, yes, it is my router webpage which is using a Cisco self-signed certificate so the https:// is deemed "insecure" - and I need to choose to proceed anyway or add exception (depending on browser) to bypass the SSL warning and pull up the webpage. So yes, I'd say it's being seen as "untrusted" Now the suggested fix is to add the website to the list of "Trusted sites" in IE-speak. How is this accomplished in current Firefox ? I found only a forum post from 2013 that said Tools->Options->Security->Exceptions. Current Firefox "privacy & security" page has 4 [Exceptions] buttons, none of which are an obvious choice in this context!

所有回覆 (1)

more options

I think that Firefox will never show the full file path via an input type=file" attribute. This has been removed a long time ago. Bug 143220 - [FIX]Script can get the value of a file control, including the path