Problem sending additional post data to server with uploadify

前端 未结 2 970
萌比男神i
萌比男神i 2021-01-16 02:52

I\'m using uploadify on a page that allows a user to upload images as well as a category field in which to send those images. Now, I see that uploadify provides a \"scriptDa

2条回答
  •  情书的邮戳
    2021-01-16 03:12

    you would need to fetch the current state of the user's input via one of uploadify's callback hoock: onOpen or onSelect . See their documentation for the right one. I guess onOpen is more reliable as it will check the current state of user input everytime an upload is started. Still, you might need to disable other user inputs while an upload is ongoing, or still require the user to submit the form, otherwise any user input done after the last upload has started will be lost.

    Anyway, I found this on their forum, which i would put on a onOpen callback:

    $('#fileInput2').uploadifySettings(
    'scriptData', 
    {'ext':$('#dirTimeStamp').val(), 'ext2':$('#txtEmail').val()}
    );
    

    A final implementation would be (using the demo code) :

    
    
    

提交回复
热议问题