rickjs
Total posts: 8
29 Jan 2015 19:27

I've created a test json file but get this error, "File of wrong extension. Only Zip, Csv and JSON are allowed". This error is not very descriptive since I got the same error when the csv file was not in the right format. The csv works but only after some editing, seems to need proper format. Output from myPHPAdmin query export doesn't work for csv or json either. Also found that after the error, the page needs refreshing to import again. So I need a sample json file to see if this works. My test json file contains this...

[{"Title": "Your Site", "Definition": "Some Stuff"}]

I have a field called "Definition".

Thanks,

Rick

Last Modified: 07 Feb 2015


Sergey
Total posts: 13,748
30 Jan 2015 02:00

JSON not working very well. Because of indefinite structure.

Try to ZIP json file before upload.


rickjs
Total posts: 8
30 Jan 2015 19:38

Hi,

I tried a zipped json with same error. Is there a special way to create a zip or a certain version of zip like from 7zip?

Rick


rickjs
Total posts: 8
30 Jan 2015 21:49

Hi,

I created zip with 7zip adding the test json file and was able to read in on Step 1 but on Step 2 there's no fields to select. I'm including the zip file.

Ricktest


Sergey
Total posts: 13,748
03 Feb 2015 12:55

What is exact message?


rickjs
Total posts: 8
03 Feb 2015 22:34

There is no message, there are no fields to select in step 2.

Rick


Sergey
Total posts: 13,748
04 Feb 2015 03:56

That is why I am saying JSON not working well.


rickjs
Total posts: 8
05 Feb 2015 19:50

Debugging your code in the controller file import.php, I follow into the function _load_json. It reads the json file and extracts the row. But on return of $this->_load_json($upload) , it's not clear what variable is created. I'm assuming the variable is $this->heads since is passed into the session. The variable $this->heads never gets created.

Rick


rickjs
Total posts: 8
06 Feb 2015 20:01

To further comment on the json data. In function _row on line $columns = array_keys($data); , $data array is populated but the function doesn't produce $columns data.

Rick


hwdevteam VIP
Total posts: 76
07 Feb 2015 02:09

Rick - This may be completely unrelated but I'll mention it anyhow..

I had a problem like this a fwe days ago, it was simply that I was using front end code in an ajax back end call - the sessions were different !!

Cheers, Pete

Powered by Cobalt