• Resolved yst14

    (@yst14)


    Hi,

    I have noticed that when exporting and then importing each browser seems to read the file differently as I get these errors on different browsers:

    application/txt
    text/html

    Is it at all possible to define more than 1 mimetype?

    Current code:

    public function import_mime_types_noou_swatches_options( $aMineTypes ) {
        $aMineTypes[] = 'application/json';
        return $aMineTypes;
    }

    https://www.ads-software.com/plugins/admin-page-framework/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Can you post the exact errors you got?

    Also tell me how I can reproduce the problem.

    Thank you.

    Thread Starter yst14

    (@yst14)

    I exported a .json file from my plugin. I am then trying to import the same file into my plugin.

    Firefox: The uploaded file type is not supported: application/txt
    Chrome: Works
    Safari: Works

    Earlier when i tried with the same export file I had the following:

    Firefox: The uploaded file type is not supported: application/txt
    Chrome: text/html
    Safari: application/txt

    It seems to be very intermitent but you can download the latest version of the plugin from this link and try it yourself. I am using a blank WP install.

    Repo:
    https://bitbucket.org/ben_noou/noouswatches/

    Download:
    https://bhwd.me/noouswatches.zip

    Install Plugin
    Go to swatches
    Add colour & save
    Go to options
    export settings
    import the exported file.

    Thanks
    Ben

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    I tried your plugin and saved some colors, exported the options, deleted some colors and saved the options, and imported the exported json file. Then the colors got updated without any error in FireFox and Chrome.

    It might be something to do with your server configurations. Do you have a different server that you can test?

    Thread Starter yst14

    (@yst14)

    I will try on another VPS that I have and come back to you.

    Thanks
    Ben

    Plugin Author miunosoft

    (@miunosoft)

    And

    Is it at all possible to define more than 1 mimetype?

    Yes you may add the one caused the error.

    public function import_mime_types_noou_swatches_options( $aMineTypes ) {
        $aMineTypes[] = 'application/json';
        $aMineTypes[] = 'application/txt';
        return $aMineTypes;
    }

    Not sure if it helps because I don’t get the error you got.

    Thread Starter yst14

    (@yst14)

    Just tried it on another hosting (not VPS) and in firefox I am having an application/txt error as per above.

    Is it possible to define these formats all together to prevent this?

    Plugin Author miunosoft

    (@miunosoft)

    Is it possible to define these formats all together to prevent this?

    You can try the above code posted in the previous reply. Let me know if it works or not.

    Thread Starter yst14

    (@yst14)

    That seems to have worked! No more issues when adding in the other mimetypes.

    Plugin Author miunosoft

    (@miunosoft)

    Glad to hear it!

    Thread Starter yst14

    (@yst14)

    Only thing left to do is try and wrap certain page arrays in an IF for the licensing.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Import Bug?’ is closed to new replies.