get file names from uploadify jquery plugin

后端 未结 3 1998
一整个雨季
一整个雨季 2021-01-14 21:30

that is my first post

I am trying here, to get the names of the files that are uploaded, so that the user can delete it if desired, the same way as yahoo.

相关标签:
3条回答
  • 2021-01-14 22:12

    why didn't you just set the removeCompleted option to false. It queues all the uploaded files.

    0 讨论(0)
  • 2021-01-14 22:29

    Quote from uploadify

    fileDataName

    The name of your files array in the upload server script. Default = ‘Filedata’

    PHP code

    $_FILES['Filedata']['tmp_name'];
    
    0 讨论(0)
  • 2021-01-14 22:30

    thanks to "Codler", I could solve this problem, I will share the code, maybe it will help.

    $("#uploadifysub1").uploadify({
            'uploader'       : 'JS/uploadify.swf',
            'script'         : 'JS/uploadify.php',
            'cancelImg'      : 'cancel.png',
            'buttonImg'      : 'attach.png',
            'folder'         : 'uploads',
            'queueID'        : 'divquickuploadProgress1',
            'auto'           : true,
            'multi'          : true,
            'onComplete'     : function(event, queueID, fileObj, reposnse, data) {
                // write your own implementation
                               }
        });
    

    my implementation was like that

    var cod = '<tr>';
    cod += '<td align="left">'+fileObj.name+'</td>';
    cod += '<td align="left">';
    cod += '<span onclick="removeprev(this,'+fileObj.name+')" style="cursor: pointer;">&nbsp;';
    cod += '[remove]</span>';
    cod += '</td>';
    cod += '</tr>';
    $('#uploaded_files').append(cod);
    

    Thanks again

    0 讨论(0)
提交回复
热议问题