Is Import And Export For 4.1.2 Broken?

I think the export feature in 4.x.x is buggy.

I am trying to export from 4.1.2 and import to another version of 4.1.2, I am using the default delimiters and exporting to local.

But something is wrong with the exported files, instead of getting a csv file that makes any sense, all I am getting is a csv file full of gibberish and seemingly random characters

I don’t know what’s causing this, but I have 2 installs of 4.1.2 on my server, and both of them are exporting garbage files. I also have a 3.0.6 install on my server and that is producing legible csv files.

has anyone seen this before and most importantly, does anybody have a solution ?

I’ve emailed cs-cart but their service is pretty much hopeless and i wont hear back from them for at least another week or so.

This has been such a painful experience, with people having this problem never replying back to their threads to help others with the same problem, so I thought I'd share the fix for this.

So, for anyone having this same problem with the export file being full of garbage while using the 4.x.x version of the cart, the problem is in the file fn.fs.php file located in the app/functions/ directory of the cart install.

This is my original 4.1.2 code, with this code the export just exports random garbage


header(“Content-disposition: attachment; filename="$filename"”);

header('Content-Encoding: ', true);

header('Content-type: ' . fn_get_mime_content_type($filepath));

header('Last-Modified: ' . $ftime);

when CS cart fixed the problem they commented out these lines, which fixed the problem for me and the export files became readable.


header(“Content-disposition: attachment; filename="$filename"”);

//header('Content-Encoding: ', true);

header('Content-type: ' . fn_get_mime_content_type($filepath));

header('Last-Modified: ' . $ftime);

Hope this helps somebody

Helps me , thanks

it would show fine when exporting to screen but didnt encode properly when downloading


bytraper, you are an absolute legend.

Thanks so much for this. We had this very issue today.


Thank You!

great! this helped a bunch