PHP-Get input-file file name, suffix name (ie compatible)

Source: Internet
Author: User

1, when using the file control to upload files, sometimes need to get the file local path to show to the customer, this way can get the file local path: document.getElementById (' FILE_UPL '). Value This is not a problem in IE7 and the previous version of IE browser, but to IE8 above, it is not, in IE8 you will only get to such a path: "C:fakepathxxx", where xxx is your file name. What's going on here? Originally, IE8 for security reasons, the uploading of files to block the real local file path, and "C:fakepath" replaced. But what if we want to get a real local file path? You can get the real path by setting the browser security option:

Internet Options, security, custom level, upload local files to server with local directory path, and select Start, OK

2, however, as a developer, we can not expect customers to do so, so we have to solve this problem through the code. For example, the HTML code for my upload file control is:

  

PHP-Get input-file file name, suffix name (ie compatible)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.