content type by extension

后端 未结 6 1188
悲哀的现实
悲哀的现实 2020-12-03 03:50

Is there any built in function that returns the content type based on the file extension?

6条回答
  •  佛祖请我去吃肉
    2020-12-03 04:13

    If it's an uploaded file. You can store the contenttype in a column of the database for later use when you upload the file. There is a property named ContentType for HttpPostedFile class.

提交回复
热议问题