Ofir Attia Ofir Attia - 1 year ago 133
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.';


Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download