importexport.xml needs accept=".sql"

Started by richardh9935, 05 January 2022, 00:05:16

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

richardh9935

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.

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

federica

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.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]