Sql file extension type

后端 未结 4 2108
面向向阳花
面向向阳花 2021-01-04 10:23

What is the sql extension type?
I want to upload to some folder in my server only .sql files.
I know that for txt is text/plain. what is for sql f

4条回答
  •  自闭症患者
    2021-01-04 11:13

    There is no way to check if it's an SQL file simply on the basis of MIME-types. SQL-files are text/plain, as others already pointed out. You would have to perform some checks on the incoming file (like running a regex which check's for SQL commands, or even running a parser/checker, if one is available in PHP), if you want to be sure only SQL files are uploaded.

提交回复
热议问题