• Resolved aveste

    (@aveste)


    Hello

    I receive this error:
    – Form could not be imported. File type must be JSON. –
    when I try to import the .json file
    exported and running from another website

    it does not happen to all the exported files,
    someone works

    I have not found solutions that can help me

Viewing 12 replies - 1 through 12 (of 12 total)
  • This support page exlains the reason but without any real info how to fix it actually:
    https://calderaforms.com/doc/what-does-the-caldera-forms-error-form-could-not-be-imported-mean/

    @shelob9 Can you please add more info how to fix this? The export is coming from Caldera Forms with the same version. New export does not help. Tried to add:
    AddType 'application/json; charset=UTF-8' .json
    with no luck.

    Any ideas?

    I’ve written a blog post about this problem (in German):
    https://torstenlandsiedel.de/2019/01/28/kaputten-import-bei-caldera-forms-reparieren/

    You need to find out which mime type your server is returning for JSON files and then you need to add this mime type to WordPress as an allowed mime type value for JSON files. At least this was my problem and solution.

    In my case the server was returning text/html instead of application/json. After adding this it worked.

    Good luck!

    All the best,
    Torsten

    oyvindeikeland: don’t work for me, my form is on 2 pages but imports only 1

    Torsten: it would be nice to be able to better understand what you are proposing
    – Upload a file with this content to the server
       in what wordpress directory?
    – Also upload the exported JSON file
    in what wordpress directory?

    – see which version of PHP is running and what it thinks is a mime type
    where is it?

    I hope to succeed

    Thank you

    Upload a file with this content to the server in what wordpress directory?

    Also upload the exported JSON file in what wordpress directory?

    It doesn’t matter 😉 I’ve uploaded it to the root folder, because that is the easiest way to find it. Then I checked what mime type my PHP is showing for this file. Therefore the file must be in the same directory or you have to use the path to the uploaded file.

    see which version of PHP is running and what it thinks is a mime type
    where is it?

    I’m not sure I understand this question. If you want to find the PHP version, the easiest way is to install the Health Check plugin:
    https://de.wordpress.org/plugins/health-check/

    The way to find the mime type for the JSON file is what the first snippet in my post is returning.

    If you get something different than application/json then something went wrong on your server config (like in my case) and you maybe could solve it by adding the mime type which is returned for you. In my case this was text/html.

    Hope this helps!

    All the best,
    Torsten

    Hello,
    I asked:
    curl -i
         -H “Accept: application / json”
         -H “X-HTTP-Method-Override: PUT”
         -X POST -d “value”: “30”, “type”: “Tip 3”, “targetModule”: “Target 3”, “configurationGroup”: null, “name”: “Configuration Deneme 3”, “description” : null, “identity”: “Configuration Deneme 3”, “version”: 0, “systemId”: 3, “active”: true
         https://anziani.info/richiesta-informazioni-preventivo-export.json

    I got this reply from Terminal

    HTTP / 1.1 200 OK
    Server: nginx
    Date: Sat, 30 Mar 2019 02:40:59 GMT
    Content-Type: application / json

    X-Powered-By: W3 Total Cache / 0.9.7.3
    X-Powered-By: PleskLin

    Hi,
    I have just experienced the same error. After researching on-line I could not find a suitable solution. However I then tried this;

    Went to this URL: https://jsonlint.com/
    Opened the json file with a text editor, copied it then pasted into jsonlint, clicked on the validate json button. Copied the result back into the original json backup file.

    After this Caldera forms imported the file with no further problems.

    I’m happy for you
    I tried to validate it
    but I always receive the same error
    -Form could not be imported. File type must be JSON-
    I believe he exports it incorrectly, so as not to recognize it,
    the thing that disgusts me is assistance, even on facebook, no help
    I solved with another plugin

    what disgusts me is the lack of assistance, compared to the other free plugins,
    certainly my experience will be shared at least here in Italy

    anyway thanks and good life

    Torsten, I just wanted to say thank you in this thread as well. Since some of the other folks here seemed to have mixed results or be complaining about some other solution not working, I was almost discouraged from trying your solution, but it worked 100% for me.

    All I needed was the code at the end of your post in my functions.php. The MIME type of text/html matched my configuration as well.

    Thank you again for your time and effort figuring this issue out.

    Thanks @dmatamales,

    very much appreciated! 🙂

    All the best,
    Torsten

    @zodiac1978 Any chance you could post your code again, the one @dmatamales said worked for him? Your original uploads are not visible anymore.

    Thanks.

    @zodiac1978 YES! That worked for me as well. I appreciate your response. My CF json files were all coming back with mime type text/html. Adding that to functions.php solved the issue.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘error import’ is closed to new replies.