Why am I getting mime-type of .csv file as “application/octet-stream”?

后端 未结 4 682
忘掉有多难
忘掉有多难 2020-11-29 07:04

I\'m working on a PHP application that must import an excel file into MySQL. So I need to convert the excel file to .csv format. But when I want to get its type using

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-29 07:50

    $_FILE['something']['type'] is populated by the browser / user OS, so it is not reliable. You should make your own check at server side to determine if uploaded file was in desired format.

提交回复
热议问题