Skip to content

Upload problem #3262

@mguinness

Description

@mguinness

Firstly thanks for this amazing library. I'm having an issue when I try to upload a file named GitHub.url with the following contents:

[InternetShortcut]
URL=https://github.com/

It's an Internet Shortcut (.url file) that is created in Windows. During upload the kind variable in the code below is incorrectly set as 'string' instead of 'file'.

kind = (trf.items && trf.items.length && trf.items[0].kind)? trf.items[0].kind : '',

In the Chrome browser console below there are two entries, the first from a text file upload and the second from the url file upload. As you can see the second DataTransferItemList has 3 items instead of 1 and with the code above it only looks at the first item.

tfr

I'm not sure what the best solution would be, but I think the code should grep for file and if not found use the first item?

You can use the fiddle created at https://jsfiddle.net/ghvfdyam/ to reproduce this issue in both Chrome and Edge browsers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions