Preview The js Code of the client's local image on the page (compatible with ff ie)

Source: Internet
Author: User

My company recently had a project with this requirement. I found that the method I used in this article to get the local image path of users through JS only supports preview of local images on the local page.
One solution is to return relative paths after uploading to the server, but the efficiency is a problem, and the programming complexity will be improved.
Directly use the demo code to provide source code reprinted for more peers who have such requirements but cannot find a solution. Please indicate the source. I have more solutions to other problems for your reference.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <meta http-equiv =" content-Type "content =" text/html; charset = gb2312 "/> <title> get file input full path </title> </pead> <body> <input type =" file "onchange =" getFullPath (this ); "/> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.