Author Topic: importexport.xml needs accept=".sql"  (Read 15 times)

Offline richardh9935

  • Coccinella
  • *
  • Posts: 15
  • Karma: +0/-0
importexport.xml needs accept=".sql"
« on: 05 January 2022, 00:05:16 »
To migrate my v3.1.5 Abook data to my testing v4(beta) system, I exported using the MYSQL export. That worked fine.
The import failed because the import_file step could not accept the particular file I wanted to use.
To make the import succeed, I had to change line 26 of .../Administrator/components/com_abook/models/forms/importexport.xml to accept a file with a .sql type.

The block of code was:
      <field name="import_file"
                        type="file" accept="text/*"
                        label="COM_ABOOK_FIELD_PARAMS_EBOOK_LABEL"
                        description="COM_ABOOK_FIELD_PARAMS_EBOOK_DESC"

I changed it to:
      <field name="import_file"
                        type="file" accept=".sql"
                        label="COM_ABOOK_FIELD_PARAMS_EBOOK_LABEL"
                        description="COM_ABOOK_FIELD_PARAMS_EBOOK_DESC"

I confirmed that the v3.1.5 and the v4.0.0Beta versions of importexport.xml are the same.

I'm using Safari 15.2 on macOS 12.1.

Vox Populi(x) forum

importexport.xml needs accept=".sql"
« on: 05 January 2022, 00:05:16 »

Offline federica

  • Amministratore
  • Delfino
  • *****
  • Posts: 1.080
  • Karma: +2/-0
Re: importexport.xml needs accept=".sql"
« Reply #1 on: 05 January 2022, 10:33:41 »
Hi richardh9935,
thanks for your suggest. My browser (firefox on linux) allows to upload sql file as "text" mime type without problem. Probably Safari is more fussy
Due to the field is used to upload both .csv and .sql file it is better to set accept="text/*, *.sql"
I fixed the bug. You can download the updated version.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
http://www.antivirushelp.it
stacca la spina!

Vox Populi(x) forum

Re: importexport.xml needs accept=".sql"
« Reply #1 on: 05 January 2022, 10:33:41 »