Hmm, interesting π
It does a check for the Mime Type, but looking at the ‘()’ it has no mime type set. I would blame Wordpad for that π
I think there are two ways to go about it. You could either change the mime type of the file, but I don’t know how to do that. Or you could go to the file admin/gb-page-import.php file on line 491, and change the line:
if ( ! in_array( $mimetype, $mimetypes ) ) {
to:
if ( in_array( $mimetype, $mimetypes ) ) {
This will make your CSV without mime type be accepted.
I will see if the error message can be made be less cryptic.
Also, you could check if your PHP installation has the Fileinfo extension.
Thread Starter
trois
(@trois)
Thanks for fast reponse.
I did alter that line in page-import.php, but now get this error:
“It seems your CSV file is from an export that is not compatible with this version of Gwolle-GB.”
The comments-file from the PHP script (txt), I edited and updated according to the export-file that I created myself (and the one you provide), and now I keep running into this error:
“Your data seems to be corrupt. Import failed. I’m sorry, but I wasn’t able to import entries from the CSV file.”
I figure it has something to do with the fields that are missing, like location, host etc. I put in single letters, as replacements, but does your import check those, somehow?
I could mail you my CSV file?
Hi, you can mail your CSV to marcel@timelord.nl if you want.
I suspect there are quoting issues. LIke each field needs to have quotes around it, but Excel and WordPad probably break that. Then, when the content of an entry does have quotes, it all breaks.
Thread Starter
trois
(@trois)
Thanks Marcel, appreciated.
I mailed you the files and examples last night.
Hi, I just sent an email back with a CSV that does import.
The thing about a CSV is that the fields are separated by comma’s, and each field is encapsulated inside quotes.
So this is wrong:
“2,JJJ,info@example.com,Munich,http://www.example.com,10.0.0.20,example.com,””Mijn eerste gast!””,1486659934,0,1,0,”
because you only have two fields here, and they are not even separated by a comma.
And this is right:
“2”,”JJJ”,”info@example.com”,”Munich”,”http://www.example.com”,”10.0.0.20″,”example.com”,”Mijn eerste gast!”,”1486659934″,0,1,0,
About the dates, cutting off the last 5 digits will make it a date of around “1 januari 1970, 11:50” which is probably not your intention. If the timestamp has 10 digits, you want to keep it 10 digits. If you don’t care about the time, it will be quite hard to find the correct number for 0:00:00 :). You are better of not showing the time, just the date. You can do that in Settings > Reading-tab.
bbPress is eating my reply…
I mailed you the reply.
Thread Starter
trois
(@trois)
Thanks Marcel,
I got your mails. What values would you use for empty fields? My export-file from the previous guest-book script doesn’t provide host (but includes IP), location etc. Would two quotes (“”) do?
Going to update my import-file – will report back later on.
Yes, “” should be fine. Or just nothing is fine too afaik.