Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

google chrome - Getting a fakepath when trying to upload a cv

I'm trying to upload my resume to a company's website and I'm getting a C:fakepathmyfilename, Does this means that my file can't be uploaded to the website? or is it just for security reasons? (I tried uploading with Microsoft Edge and Chrome)

question from:https://stackoverflow.com/questions/65922733/getting-a-fakepath-when-trying-to-upload-a-cv

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

When a file is chosen using an <input type="file">, the real path to the source file is not shown in the input's value attribute for obvious security reasons. Instead, the filename is shown, with C:fakepath appended to the beginning of it. There are some historical reasons for this quirk, but it is supported across all modern browsers, and in fact is defined in the spec.

So, the browser shows the fake path for security reasons and it will not cause any issue with the file upload functionality. The file upload will work fine.

References:

  1. Refer to the second point of the Notes section
  2. FileUpload in Chrome giving some fake path value
  3. FakePath issue in Chrome browser

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...