Ofir Attia Ofir Attia - 2 months ago 18
PHP Question

Sql file extension type

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 files?


if($_FILES['userfile']['type'] != 'THE SQL EXTENSION'){
echo ' File is not an sql file.';
exit;
}


thanks.

Answer

There is no special MIME type for SQL. Just use application/octet-stream.

See @Vroo's answer below (application/sql). Since RFC6922 was published, this answer is no longer correct.

Comments