ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Problem with sql mime type

January 09, 2012 5:02pm

Subscribe [2]
  • #1 / Jan 09, 2012 5:02pm

    baradji

    9 posts

    Hello,
    I can’t download a sql file.I got a error message:
    The filetype you are attempting to upload is not allowed.

    In my controller, i use $config[‘allowed_types’] = ‘log|sql’;
    and in mimes.php, I put the line: ‘sql’  => ‘text/x-sql’,
    but I have already problem to download my file.

    think

    http://www.baradji.com

  • #2 / Jan 09, 2012 8:12pm

    CroNiX

    4713 posts

    Its just a text file.  Try ‘text/plain’ for the mime type.  And I assume the file is named with a sql extension, like something.sql?

  • #3 / Jan 10, 2012 11:31am

    baradji

    9 posts

    hello,
    I try your script, but it did not work any more. I had the same message:The filetype you are attempting to upload is not allowed.it is not work any more with the log file.
    in mime.php(‘log’ => array(‘text/plain’, ‘text/x-log’))
    but it works with the txt file, but I want to use log or sql file.
    Does some body have a solution?

    http://www.baradji.com

  • #4 / Jan 11, 2012 2:29pm

    baradji

    9 posts

  • #5 / Jan 11, 2012 3:13pm

    baradji

    9 posts

    very strange,
    I get the mime of my sql file by: echo $_FILES[‘userfile’][‘type’] in the my function and it give me
    application/octet-stream.
    so I replace in mime.php (‘sql’  => ‘application/octet-stream’)
    and abrakadabra, it worked well.

    http://www.baradji.com

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases