Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

addFile() not working with Pluplod's own file objects #756

Closed
srissel opened this Issue · 1 comment

2 participants

@srissel

If feeding files from a second Plupload instance (let's say an arbitrary one) into another (let's say the main one) Plupload instance, no files are added actually.

this.mainUploader.addFile(uploaderArbitrary.files);

The reason is:
Method addFile() calls local function resolveFile(file). This determines the file's type by

o.typeOf(file)
which in the upper case returns "object".
This case is not covered by resolveFile() method.

Suggestion:
Introduce new case to extract native file from plupload file object:

function resolveFile(file) {
var type = o.typeOf(file);

if (file instanceof o.Blob) {
    ...
} else if (type === 'file') {
  ...
} else if (type === 'object' && file.getSource() && file.getSource().getSource()) {
 /* this is the new case */
 /* we call ourselves again, with the native file object */
                resolveFile(file.getSource().getSource());
} else if (type === 'node' && o.typeOf(file.files) === 'filelist') {
    ...
} else if (type === 'array') {
    ...
}

}

Kind regards,
Sascha.

@jayarjo
Owner

Obvious omission.

@jayarjo jayarjo closed this in d0732bd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.