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>