Comments (3)
It is the browser that reveals the mime type. Standards exists for how the whole reading of files goes in a browser. This package, angular-file, essentially wraps all the adhering of standards for browser file reading into an Angular package.
For the mime type, this package, just takes what the browser gives it during select/drag/drop and then it does it's best to see if mime types match occurs as follows:
- This package tries an exact mime match as seen in this code:
- This package tries to match by file extension as seen in this code:
All of the above mentioned mime type comparing and parsing, is unit tested in this code here:
https://github.com/AckerApple/angular-file/blob/development/src/file-upload/fileTools.spec.ts
Please let me know if you have additional input, see a mime type comparison issue, love pinball, or let me know anything else I can help with
from angular-file.
"Or am I missing something ?"
Yes, that is correct.
Are you using Internet Explorer or Internet Edge? As I last came to understand, during drag drop they don't reveal a files mime type. I've seen a few browsers that think it's a security risk to reveal any file information about a file during drag just incase the drag/drop is not intended for whats being dragged over.
So try, instead of drag/drop, selecting files and see if you get the results you desire.
Lastly, this package does NOT keep any mime type listings. It's up to you to type in the correct mime type. I've seen CSV as many things including text/comma-separated-values
. Files can even be written with no mime type and then its up to the code to decide to assume the file extension is the right type.
Mime typing is a long a vast story. I recommend using more star like validations such as image/*
or text/*
Good luck to you
from angular-file.
Thanks for the answer
No, I use Firefox..
Maybe you answered to this and I didn't get it but I have one last question to clarify my thoughts...
Who determine the file type (see picture) when they are dragged or selected ? Is it your composant (angular-file) or the browser ?
Thanks again :)
from angular-file.
Related Issues (20)
- build using 3.9.2 fails HOT 10
- Handle folders on drop HOT 1
- Outlook add-in client is crashed when picking files from windows file picker HOT 2
- Error when creating in Ivy modeγ HOT 7
- Custom files binding not working HOT 5
- map files not included in the build (2.0.0 || 3.0.0) HOT 16
- Changelog for version 3? HOT 1
- A vulnerability exists in the file restriction with the same name
- Pratical example in Readme is not working HOT 1
- Chunk Upload Possibility HOT 1
- pre-play video before uploading it to the server HOT 6
- Build against Angular 10 HOT 1
- Any recommendations on how to ensure files dragged over are unique HOT 1
- Please add documentation for (filesChange) HOT 3
- is it possible to upload angular dependecies to v11? HOT 11
- Cannot read property 'nativeElement' of undefined - Angular 5 HOT 1
- ngfFixOrientation breaking some images HOT 2
- Issue with 3.5.0 release. HOT 6
- 3.5.3 ngfSelect not respecting multiple HOT 9
- File attributes are set on the `label` element when host element is not already a file input HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-file.