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.
A SQL file contains Structured Query Language (SQL), which is a language used to access and modify information in a database. It stores SQL statements for creating or modifying database structures, insertions, updates, deletions, or other SQL operations.
The SQL script file is a container for SQL statements or commands. When you run SQL statements from a client such as JSqsh, the script file is a convenient way of manipulating large numbers of statements.
With all of the objects scripted out as ALTER statements, in a single query window, simply choose SQL Prompt's Format SQL option, or use the Ctrl+K, Ctrl+Y shortcut, in order to format the script in the desired manner.
The official answer according to IANA is application/sql
. See http://www.iana.org/assignments/media-types/media-types.xhtml and https://www.rfc-editor.org/rfc/rfc6922
However, since lots of people don't bother to read documentation you might also want to accept text/sql
, text/x-sql
and text/plain
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With