Frage

I'm making a file uploader whereby a user can select a file, and then an input appears where they can put in the expiry date of the document and I want to pass this in as part the uploadSuccess Params. I'm using FineUploaderS3.

This question nearly provides the answer but I'm having issues calling the .setUploadSuccessParams method.

I've tried two different methods and neither of them seem to work, but I feel like I'm just screwing up the syntax somewhere.

So one method:

callbacks: {
    onUpload: function(id,name){
        this.setUploadSuccessParams({expiryDate: $('#expiryDate').val()},id)
    }

Doesn't work.

The other method:

$('#submit).on('click',function(){
    element.fineUploaderS3('setUploadSuccessParams',{expiryDate: $('#expiryDate').val()});
}
// Element is the element that I originally called the .fineUploaderS3 function
// I'm calling element.fineUploaderS3('uploadStoredFiles') function that that works
// fine I think I'm just not passing in the variables for setUploadSuccessParams
// Correctly

Any help or advice would be greatly appreciate!

Thanks in advance

EDIT:

This answer comes very close to answering what I want, but just doesn't explain how to call the functions Pass additional Fine Uploader params all the way to the uploadSuccess endpoint?

War es hilfreich?

Lösung

So it turns out my error was in how setUploadSuccessParams works. I assumed that it updated the upload success params, but in fact it replaces all the upload success params.

In my code I was initially setting some params (such as a users id in our database), and then later trying to add the expiry date. It turns out I have to set all params at the same time (when I was adding the expiry date).

Thank you for all the help on this one!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top