Topic: programmatically add files and the max_file_count option

hi there,
at first sry for my bad english! wink

i use the plupload API since 2 days and i try to add already uploaded files to the queue, so the user can decide to delete the file and e.g. upload another file.

adding already uploaded files is not a big deal

Init: function(up) {
    {if $Questions.$question_id.uploadedFiles}
        var files = new Array();

        {foreach $Questions.$question_id.uploadedFiles file}
        var file = new plupload.File('{$file.id}','{$file.name}','{$file.size}');
            file.percent = 100;
            file.loaded = {$file.size};
            file.status = plupload.DONE;
        files.push(file);
        {/foreach}
        
        up.files = files;
        
        var queueprogress = new plupload.QueueProgress();
        queueprogress.size = {count $Questions.$question_id.uploadedFiles};
        queueprogress.uploaded = {count $Questions.$question_id.uploadedFiles};
        queueprogress.percent= 100;

        up.total = queueprogress;
        up.trigger("QueueChanged");
        up.refresh();
    {/if}
}

I see the files in the queue and have the ability to delete them, but if i e.g. delete 2 of 3 files and try to upload another file, i get an error like
"Upload element accepts only 3 file(s) at a time. Extra files were stripped."

So why up.removeFile() doesn't delete the file from the filelist? or how can i delete it manually?

I hope someone has an idea

Thanks in advance
Michael