c# - Get original file extension and content type -


suppose have file name test.txt. if change extension of file .xls.

now file name test.xls instead of test.txt.

then how can know original file type of file?

you can't. there no way retrieve previous extension or content type file.

you can try parse file (for example pdf documents start %pdf), isn't real solution in opinion, since need know format of each , every file format.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -