javascript - How to assign remote files to input files?
phpcn_u1582
phpcn_u1582 2017-05-16 13:23:13
0
1
516

How to

<input type="file">

I get the file URL through ajax and assign a value to the files attribute of the input. It has the same effect as clicking the input to select a local file. How to do it?

phpcn_u1582
phpcn_u1582

reply all(1)
洪涛
$.ajax(...,function(url){
    var a =document.createElement("A");    
    a.innerHTML = 'Link';
    a.setAttribute("href",url);
    document.body.appendChild(a);
})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template