cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon-Pierre Tessier (JIRA)" <>
Subject [jira] [Commented] (CB-12515) returns [object Object] instead of [object File]
Date Thu, 18 May 2017 15:11:04 GMT


Simon-Pierre Tessier commented on CB-12515:

Hi Kerri,

I had the same problem with using Cordova and Filestack a third party uploader. As you stated,
to determine if an object if a file, they call the Object.prototype.toString which is my case
returned "[object Object]".

We were able to fix this with a dirty workaround (ie overriding the toString function of the
file object)

fileEntry.file(function(fileEntryFile) {
    fileEntryFile.toString = () => '[object File]'; // This is a dirty workaround, please
don't judge :P
    filestackClient.upload(fileEntryFile, {}, storeTo);

Hope this helps anyone facing this issue.


> returns [object Object] instead of [object File]
> -------------------------------------------------------------------------------------
>                 Key: CB-12515
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-file
>            Reporter: Alexander Broekhuis
> I'm trying to use the File plugin in combination with FineUploader. FineUploader uses
the File API and tests if a passed in object is a file using the following call:
> === "[object File]"
> But the File retrieved from a FileEntry using entry.file(function(file) { ... }); is
not seen as a file since the returns [object Object].

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message