Home Input File async in ASP UpdatePanel
Reply: 0

Input File async in ASP UpdatePanel

Francesco Quarto
Francesco Quarto Published in 2018-01-12 20:39:41Z

I'm trying to pass the contents of an input file asynchronously. The input control is located within an UpdatePanel control. I can only use the HTML input file control and I do not want to generate the postback. Ok. Is there a way, even using JavaScript? To understand better: in my project I must be able to publish posts (like facebook) that have an image besides the text. Therefore it must take place asynchronously. When the user loads the image, the preview is generated by saving the cached data.

<img id="imgoutput"/>
<input id="upload1" type="file" name="upload1" accept="image/*" onchange="loadFile(event)" />

var loadFile = function (event) {
    var output = document.getElementById('imgoutput');
    output.src = URL.createObjectURL(event.target.files[0]);

Is there a way to somehow manage to recover the file by acting on the cache when I try to publish the post?

Thank you

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.332287 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO