Menu

#4661 (ok 4.3.4) Drag and drop file import always fails.

4.3.2
fixed
None
1
2015-01-13
2014-12-20
Benjam
No

ERROR! The markdown supplied could not be parsed correctly. Did you forget to surround a code snippet with "~~~~"?

I used the Chrome feature where I could drop a file on to a file upload input field, and it would automatically fill in the field with the file I dropped on it. Now that PMA has the drag and drop feature to upload import files, I can longer use that feature of Chrome.

The problem wouldn't be so bad, except that the drag and drop feature of PMA always fails. It can never upload the file.

Here is the JSON returned from the import.php request: {"success":false,"error":"\n<!-- PMA-SQL-ERROR -->\n    <div class=\"error\"><h1>Error<\/h1>\n<p><strong>SQL query:<\/strong>\n<a href=\"db_sql.php?sql_query=SET+NAMES+%27utf-8%27&amp;show_query=1&amp;db=favred&amp;token=9bbccdf3a8375e35ad9e5091aa31068d\"><span class=\"nowrap\"><img src=\"themes\/dot.gif\" title=\"Edit\" alt=\"Edit\" class=\"icon ic_b_edit\" \/> Edit<\/span><\/a>    <\/p>\n<p>\n<code class=\"sql\"><pre>\nSET NAMES 'utf-8'\n<\/pre><\/code>\n<\/p>\n<p>\n    <strong>MySQL said: <\/strong><a href=\".\/url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen%2Ferror-messages-server.html\" target=\"mysql_doc\"><img src=\"themes\/dot.gif\" title=\"Documentation\" alt=\"Documentation\" class=\"icon ic_b_help\" \/><\/a>\n<\/p>\n<code>\n#1115 - Unknown character set: 'utf-8'\n<\/code><br \/>\n<\/div>"}

The file I am trying to drag and drop is an export file from a previous version of PMA.

I'm not sure why the importer works when I use the form field normally, and fails when using the drag and drop upload. But it seems that if my server understands UTF-8 in one case, it should understand it in another.

Anywho... if you need anymore information from me, please don't hesitate to ask.

Windows 7 64
PHP 5.6.3
MySQL 5.6.20-log

Discussion

  • Marc Delisle

    Marc Delisle - 2014-12-20

    I assume you are importing a .sql file. How was it produced?

     
  • Benjam

    Benjam - 2014-12-20

    It was made with an older version of phpMyAdmin.

     

    Last edit: Benjam 2014-12-20
  • Benjam

    Benjam - 2014-12-20

    Here are the first few lines of that file:

    -- phpMyAdmin SQL Dump
    -- version 3.3.7
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Dec 19, 2014 at 11:08 PM
    -- Server version: 5.5.32
    -- PHP Version: 5.3.10-1ubuntu3.8
    
    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    
    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;
    
    ... snip ...
    
     

    Last edit: Benjam 2014-12-20
  • Marc Delisle

    Marc Delisle - 2014-12-20

    This is curious, in your file I see "SET NAMES utf8" and not "SET NAMES utf-8".

     
  • Benjam

    Benjam - 2014-12-20

    I noticed that as well. But that is the file I used.

     
  • Marc Delisle

    Marc Delisle - 2014-12-20

    I guess that if you remove this line from the file, you'll still get the error. Please confirm. If so, the statement is coming from the code.

     
  • Benjam

    Benjam - 2014-12-20

    Confirmed. I removed the line and the failure persists.

     

    Last edit: Benjam 2014-12-20
  • Madhura Jayaratne

    • assigned_to: Madhura Jayaratne
     
  • Benjam

    Benjam - 2014-12-22

    The UTF8 is no longer displaying, but now I'm getting an error message that has no information.

    Here is the JSON response:

    {"success":false,"error":"<div class=\"error\"><img src=\"themes\/dot.gif\" title=\"\" alt=\"\" class=\"icon ic_s_error\" \/> # Error<\/div>"}
    
     
  • Madhura Jayaratne

    Are you able to share with up a small sql export to recreate the issue obscuring any sensitive data.

     
  • Madhura Jayaratne

    • status: open --> pending
     
  • Benjam

    Benjam - 2015-01-13

    Just tested on the latest master branch, and it seems to be working now.

    If I find any SQL files that fail in the future, I'll pass them along to you.

     
  • Madhura Jayaratne

    • summary: Drag and drop file import always fails. --> (ok 4.3.4) Drag and drop file import always fails.
    • status: pending --> fixed
    • Priority: 5 --> 1