[Patch] ImportCSV first step fails

Extension ImportCSV fails at the first steps and give page not found error for hard-coded url ‘importcsv/default/upload’. Perform following actions to resolve it.

Step 1: Comment the code in assets/download.js




$(document).ready(function(){

   /*COMMENT Only following   

      var button = $('input#importStep1'), interval;

        $.ajax_upload(button, {

            action : '/importcsv/default/upload',

            name : 'myfile',

            onSubmit : function(file, ext) {

                $("div#importCsvFirstStepResult").text('Loading...');

                this.disable();

            },

            onComplete : function(file, response) {

                this.enable();

                $("input#fileName").val(file);

                $("div#importCsvFirstStepResult").html(response);

            }

        });

   */ /*There is other code, just keep them*/

..............

..........


});



Step 2: Add following code at the end of view/index.php





<script type="text/javascript">

$(document).ready(function(){

         var button = $('input#importStep1'), interval;

        $.ajax_upload(button, {

            action : '<?php echo Yii::app()->createUrl("/importcsv/default/upload");?>',

            name : 'myfile',

            onSubmit : function(file, ext) {

                $("div#importCsvFirstStepResult").text('Loading...');

                this.disable();

            },

            onComplete : function(file, response) {

                this.enable();

                $("input#fileName").val(file);

                $("div#importCsvFirstStepResult").html(response);

            }

        });

});

    </script>



The path issue is the same in controller. Need to alter at many places.

Still need to fix many issues coming up, like quoted columns and escape. I feel rewrite of the module… ::) …but in that case, I will switch to my code…

Hello apt2it,

I am a student and my professor plus the clients need our group to implement the csv file using yii since our professor let us use the yii framework for our system. I am currently confused with this csv import module I followed the steps but I can't even make it work what should be the correct path in the main config? thanks a lot. I know that it is not related with your post but hopefully you could help me thanks. God bless&#33;

Kevin tan

  • Yii application config is into the applicationFolder/protected/config folder

  • ImportCSV module is still in beta, so it seems not viable to use in every environment. I faced lot issues, so dropped and developed my code, just finished last hour.

  • At learning stage, I suggest to make your algo and create your code.

Hello apt2it,

Thanks for replying so fast, so you think it is better that I try to create my own? because my professor actually just guide our projects for our clients and the clients needed us to create a system that would read a text file that we made to a csv file so that it is easier to read and add it to our database there comes my problem to be honest I am really kind of confused with the codes that the yiiframework creates. I know the concept on how it works but the codes not yet fully but I understand them. Thanks a lot sorry for taking your time :D