jquery - FineUploader start with delete template -


i'm using fineuploader, have 1 problem. user can upload image, image might there (previous uploaded). when there image (previous uploaded), want show delete link, when there's no image.. show upload link.

how can toggle between these 2 states? specially on page loads.. , there image there.

right know im removing , adding links manually.

 $('.fine-uploader0 .qq-upload-list').append('remove');

can have template each 1 of those? , switch between them?

thanks

there no cross-browser way determine if file has been submitted. might comparing file names acceptable, it's not. fail in many situations , not reasonable choice. if there reasonable way make determination client-side (cross-browser), there no way tell fine uploader duplicate file exists.

if want prevent file being submitted, can either returning false outright "validate" event handler, or can return qq.promise later call failure on after have asynchronously determined file should rejected. asynchronous part comes in when use filereader calculate md5 hash file client-side, , either make ajax call server determine if file matching hash exists, or compare other hashes have stored client-side files submitted during current session. computing hash may quite expensive though.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -