Front-End Implementation page no refresh file upload download

Source: Internet
Author: User

Upload:

Formdata Object Implementation of 1.HTML5

  

var New FormData (document.getElementById ("FileInfo")) fd.append ("CustomField", "This is some extra data"); Ajax ({  "stash.php",  "POST",  data:fd,  false,  //  tell jquery not to handle the data sent  false   //  tell jquery not to set the Content-type request header });

Reference Links:

Http://itindex.net/blog/2012/04/14/1334367483953.html

http://ileson.iteye.com/blog/2099761

http://www.oschina.net/code/snippet_200893_26533

2.iframe the src attribute of the URL to the IFRAME

3.flash

Download:

In the case of Excel, Word can be downloaded directly with <a href= "http://xxxx" ></a> implementation

If it is a picture, use the above method will jump, so also use IFRAME to achieve, similar to the following:

function () {        document.getElementById ("IFile"). src= "Http://localhost:8000/av1.png";    },  
<a href= "javascript:void (0)" Onclick={_self._handledownload}> download </a>

Front-End Implementation page no refresh file upload download

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.