Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented access to the relative path property for uploading folders #131

Merged
merged 4 commits into from
Jun 12, 2020
Merged

Implemented access to the relative path property for uploading folders #131

merged 4 commits into from
Jun 12, 2020

Conversation

DouglasDwyer
Copy link
Contributor

I needed folder-uploading support, complete with directory structure, for a separate project. Since there does not currently appear to be a way to get directory structure, I added the ability to access webkitRelativePath from the IFileInfo interface, allowing for the support of structured folders to be uploaded using <input>. IFileInfo.WebkitRelativePath returns the relative path for any input that is marked webkitdirectory, or null if the input is not configured to upload folders.

Added the ability to access webkitRelativePath from the IFileInfo interface, allowing for the support of structured folders to be uploaded using <input>.
@Tewr
Copy link
Owner

Tewr commented May 30, 2020

In principle ok I guess. But I'm not really happy about exposing a non standard property, especially when it has a browser prefix, as it means a future breaking change.

How about a dictionary or and indexer property filled with all the non-standard properties (passing the hasOwnProperty test) of file?

@DouglasDwyer
Copy link
Contributor Author

DouglasDwyer commented May 30, 2020

While I believe the webkitRelativePath property is currently implemented across all major WASM-supporting browsers, I understand what you mean. As such, I've removed the WebkitRelativePath property in exchange for the NonStandardProperties dictionary. For any Javascript File object, it contains the properties of the File prototype not covered by IFileInfo.

@Tewr
Copy link
Owner

Tewr commented May 31, 2020

Great stuff! I'll merge this as soon as I can test it.

@Tewr
Copy link
Owner

Tewr commented Jun 12, 2020

This works as expected. Thank you for your contribution.

@Tewr Tewr merged commit bd326ae into Tewr:master Jun 12, 2020
@DouglasDwyer DouglasDwyer deleted the directory-support branch June 12, 2020 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants