Import CSV "A server error occurred while uploading the file"

Import CSV "A server error occurred while uploading the file"

blc@pulseretail.netblc@pulseretail.net Posts: 5Questions: 1Answers: 0

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

  • tangerinetangerine Posts: 2,717Questions: 22Answers: 311

    You have to provide a data file - you are providing code which needs to be run in a function.

  • colincolin Posts: 9,528Questions: 0Answers: 1,577

    Hi @blc@pulseretail.net ,

    On the browser's network tab, if you look at the response, it reports:

    <p>The requested URL was not found on this server.</p>
    <p>Additionally, a 404 Not Found
    error was encountered while trying to use an ErrorDocument to handle the request.</p>
    <hr>
    <address>Apache Server at 4-sms.net Port 443</address>
    

    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

  • blc@pulseretail.netblc@pulseretail.net Posts: 5Questions: 1Answers: 0

    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????

  • blc@pulseretail.netblc@pulseretail.net Posts: 5Questions: 1Answers: 0

    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.

  • blc@pulseretail.netblc@pulseretail.net Posts: 5Questions: 1Answers: 0

    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.

  • blc@pulseretail.netblc@pulseretail.net Posts: 5Questions: 1Answers: 0

    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.

  • colincolin Posts: 9,528Questions: 0Answers: 1,577

    Hi @blc@pulseretail.net ,

    Excellent, glad all sorted.

    Cheers,

    Colin

Sign In or Register to comment.