jaysalvat / ezdz

A jQuery plugin to turn any standard input type file into a nice drag & drop zone with validators and previews.
MIT License
89 stars 36 forks source link

multiple file inputs with image preview (preloaded from server) #14

Closed ChazyTheBest closed 8 years ago

ChazyTheBest commented 8 years ago

Hi, I'm wondering if it's possible to loop preview for each file input so I can see the currently uploaded images?

How would I do this?

Thanks!

jaysalvat commented 8 years ago

Hello! I don't understand the question :p

ChazyTheBest commented 8 years ago

Hi and sorry. I mean, if I have multiple file inputs it's possible to give a preview for each one without initialize ezdz multiple times?

Currently I just do this to initialize ezdz on all of my file inputs:

$('input[type="file"]').ezdz({text: 'Arrastrar imagen'});

So is it possible to pass to preview multiple links for each one?

jaysalvat commented 8 years ago

Hello, Ezdz doesn't work with multiple file input.

ChazyTheBest commented 8 years ago

It does indeed... The above code initializes all file inputs. Thanks anyway.

Edit: This should be working, but it's not:

$('input[type="file"]').each(function(i) {
    var folder = parseInt(getUrlParameter('id')) + '/',
        image = (i + 1) + '.jpg';
    $(this).ezdz({
        text: 'Arrastrar imagen',
        preview: 'http://www.website.com/images/' + folder + image
    });
});

The preview option it's not working.

ChazyTheBest commented 8 years ago

10