how to pass custom values in uploadify

喜夏-厌秋 提交于 2019-12-04 05:06:48
Misha Ts
  1. How to pass custom values in uploadify:

'formData': { 'userid': $("#uid").val(), 'taskid': $("#tid").val(), 'guid': $("#guid").val() },

  1. Is there any way to get the number of image in upload queue? - onDialogClose you have access to queue like this:

'onDialogClose': function(queueData) { alert(queueData.filesQueued + ' files were queued of ' + queueData.filesSelected + ' selected files. There are ' + queueData.queueLength + ' total files in the queue.'); },

To pass custom values use formData

Then you can access it on PHP $_POST['someKey']

 ...
 'formData'         : {
     'title' : $('input:text[name:title]').val(),
     'about' : $('input:text[name:about]').val(),
      ...
  },
 ..

To check number of files being uploaded, add this callback:

  ...
  onDialogClose : function() {
      console.log(this.queueData.filesQueued);
  },
  ...
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!