Import CSV "A server error occurred while uploading the file"
Import CSV "A server error occurred while uploading the file"
We can't seem to get this figured out - even after looking at similar posts. We are relatively new to DataTables Editor so I apologize in advance! We have tested this locally as well as on our hosted server and we get the same error msg after selecting the CSV file to import. There are no error messages (that we can find) to tell us what exactly is going wrong.
The URL to the test is: https://4-sms.net/sms_adm/import.html
This is the example provided with DataTables Editor except instead of using the staff.php provided we are using staff_data.php which is the following:
<?php
$data =array("data"=> array(array(
"DT_RowId"=> "row_1",
"first_name"=> "Tiger",
"last_name"=> "Nixon",
"position"=> "System Architect",
"email"=> "t.nixon@datatables.net",
"office"=> "Edinburgh",
"extn"=> "5421",
"age"=> "61",
"salary"=> "320800",
"start_date"=> "2011-04-25"
),
array(
"DT_RowId"=> "row_2",
"first_name"=> "Garrett",
"last_name"=> "Winters",
"position"=> "Accountant",
"email"=> "g.winters@datatables.net",
"office"=> "Tokyo",
"extn"=> "8422",
"age"=> "63",
"salary"=> "170750",
"start_date"=> "2011-07-25"
)
),
"options"=> array(),
"files"=> array()
);
echo json_encode($data);
Any help would be greatly appreciated - thanks!
Answers
You have to provide a data file - you are providing code which needs to be run in a function.
Hi @blc@pulseretail.net ,
On the browser's network tab, if you look at the response, it reports:
so the issue looks like the URLs you've configured aren't accessible to the client. It would be worth checking that first,
Cheers,
Colin
Well ... it really doesn't look like these "errors" have anything to do with the issue. Here are the details -
import.html:1 Mixed Content: The page at 'https://4-sms.net/sms_adm/import.html' was loaded over HTTPS, but requested an insecure favicon 'http://www.datatables.net/favicon.ico'. This request has been blocked; the content must be served over HTTPS.
/resources/examples.php:1 Failed to load resource: the server responded with a status of 404 ()
an issue with the "favicon" and the 404 error is related to "examples.php" not being found which is only because we did not load up all the examples.
We have tried this on our development system internally here and we get the exact same file upload error. We gave you the above link so that you could access it for testing.
Any other suggestions????
So, as suggested, we have cleared up those two small issues but we still get the "A server error occurred while uploading the file" error.
Thanks - help in figuring out what we are missing would be greatly appreciated.
We have simplified the test import page and have connected it to a database table to make it (as much as possible) the exact same as the example/demo provided with DataTables Editor but we are still getting the same error. We get this on our development system. Thanks.
We have figured out what the issue was. We updated dataTables.editor.js and this seemed to be the issue. Somehow we must have gotten a previous version in the mix.
Hi @blc@pulseretail.net ,
Excellent, glad all sorted.
Cheers,
Colin