ajax - Jasny bootstrap fileupload image preview error -


i'm using jasny bootstrap fileupload , working first submit. problem: after first submit working ok, image preview doesn't work anymore.

steps reproduce:
1. select photo. photo showed (img src="data:image/jpeg;base64... created inside #fileupload-preview)
2. submit form. photo uploaded ok
3. reset form. no photo showed.
4. select photo. photo not showed <= error (nothing inside #fileupload-preview)
5. submit form. photo uploaded ok

to simulate jsfiddle can:
1. choose photo
2. click 'save'
3. choose photo. error....

jsfiddle example

relevant jasny fileupload code:

<div class="fileupload fileupload-new" data-provides="fileupload">      <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;"></div>      <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>      <div>           <span class="btn btn-file">                <span class="fileupload-new">choose photo</span>                <span class="fileupload-exists">change</span>                <input type="file" name="foto" id="foto" />           </span>           <a href="#" class="btn fileupload-exists" data-dismiss="fileupload"> delete</a>       </div>  </div> 

thanks

the problem isn't in reset. instead $.ajaxfileupload breaks widget. can submit bug both jasny bootstrap , ajaxfileupload library.

however perhaps it's easier resort library upload form http://jquery.malsup.com/form/


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -