FineUploader/fine-uploader

getUploads includes a File object

barchard opened this issue · 1 comments

Type of issue

  • Bug report
  • Feature request

Uploader type

  • Traditional
  • S3
  • Azure
getUploads method includes an undocumented File object

Fine Uploader version

5.16.2

Browsers where the bug is reproducible

all

Operating systems where the bug is reproducible

macOS 10.13

Exact steps required to reproduce the issue

Try to serialize the API response from the traditional uploader

All relevant Fine Uploader-related code that you have written

let successful = uploader.fineUploader('getUploads', {
	status: [qq.status.UPLOAD_SUCCESSFUL]
});

// Throws an exception as File objects do not implement .slice
jQuery.param({
    success: successful,
    failure: failures
})

The contents of the successful array are:

batchId: "324e96b0-cf78-4bb7-80e9-c08f7817c617"
file: File,
id: 0,
name: "Screen Shot 2018-06-12 at 7.56.17 PM.png",
originalName: "Screen Shot 2018-06-12 at 7.56.17 PM.png",
size: 50728,
status: "upload successful",
uuid: "514eabf7-479a-4675-ab57-ffc373338100"

The documentation shows that this method should return:

//the uploads return value will look like this:
[
  {
    id: 0,
    name: "some_name",
    size: 12345,
    uuid: "some_uuid",
    status: "upload successful"
  },
  {
    id: 1,
    name: "some_other_name",
    size: 67890,
    uuid: "some_other_uuid",
    status: "upload successful"
  }
]

That's correct. You'll want to omit the blob if you intend to serialize this data