Tutorial detail about importcsv

Hi everyone!

I am a newbie doing learn Yii

Can you tutorial me use extension importcsv? Thanks much.

Hope some one cover import MS excel CSV, I mean UTF-16 LE CSV file.

I am waiting that someone may explain importcsv extension .

The extension at http://www.yiiframework.com/extension/importcsv/ does not work for me

Same here.

same here!

Same here

Me too hopefully someone could make one even a simple one, I can’t make the extension work :(

What error have you got? I installed the extension, it works under domain root and with clean urls(doesn’t work if you have yii app in the subdirectory or if you haven’t enabled clean urls)

Hello Vit78,

My problem now is once I upload a file it will give this error

"Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404


11/15/2011 9:45:52 PM

Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1"

What do you think should I do? Thanks a lot Vit78. I am new to yii and does not fully understand the code. :) God Bless


Hi Kevin,

The fastest way to overcome "Object not found!" error is just to uncomment urlManager in protected\config\main.php

		// uncomment the following to enable URLs in path-format











You can read in other importcsv topics that extension is still in beta and paths are hard-coded. It’s a good practice to improve someone’s extension, when you have time try to fix paths in extension source code, but quick fix, as I wrote above, just to enable clean urls.



Hello Vit,

I already did that but it is still not working. I checked it again if I already enable the urlManager but still the same. I am not that good with yii since I am new with it and so also with the codes sometimes it confuses me. Thanks for helping me Vit, so what do you think is my error?


We must crack this case, do you have firebug? I use firebug with firefox, it allows me to see every single request site has made. On my environment I installed extension here http://yiiimportcsv.localhost/importcsv

ans form posts to http://yiiimportcsv.localhost/importcsv/default/upload

See the screenshot.

Your object not found error means that something is missing on your server. I guess, Apache mod_rewrite, .htaccess, etc.

First of all can you access the extension in manner like this http://yiiimportcsv.localhost/importcsv ?

secondly, try to access upload target url like this http://yiiimportcsv.localhost/importcsv/default/upload

without any post data it should show only ‘Error: Download file is not a .csv’

I hope, you overcome ‘object not found’ and get extension to work!

Hello Vit,

Thanks for letting me use firebug, after I upload it go to this url http://localhost/importcsv/default/upload. Now I see my problem because the url should go to this http://localhost/gxi_sales/gxi_sales/index.php/importcsv/default/upload so how could I change it? Sorry for asking simple question Vit. I am really not that good with codes and does not have much experience I am currently a student right now and our prof introduce us to yii framework a little and told us to use this for our client’s project. Thanks a lot. :) I am trying to look for it now. Thanks a lot Vit, if you were not here to help me I might not able to solve this one :)


Hi once again Vit,

I was able to make it work thanks to you cheers! Thanks a lot, I finally saw my mistakes and fire bug is a big help and with you. Though not yet sure if it is working 100% if I ever encountered a problem again I would ask you about it thanks for your time. God Bless!! =)


Hi Kevin,

I’m glad, you finally got this done. What was the mistake? Your experience could be helpful for others. [size=“1”]You’re lucky to start with Yii, your prof is a wise man or woman) My prof introduced us just to some html, but it was about 12 years ago :lol: [/size]

Cheers, Vit

Hello Vit,

Sorry for the delayed reply, my path in the download.js was wrong and changed it to the right one. It was the mistake that I done and you helped me solve my problem to make the extension work. Currently I am just back in working on our project because this weekend me and my family went to a trip, that’s also why my reply was delayed need to work on it because there are much to be done. Thanks a lot vit I might ask for your help again. ^_^ Right now since the extension only add per table, but my csv’s data is scattered for the whole database and prof suggested that I create a table and then apply it so that it will be easier than modifying the extension since I have no experience or not that good in using yii. =)) I am just going to start trying it thanks a lot Vit. God Bless! :))



/* moved - not a tip, snippet or tutorial */

Thanks for the extension mate, but I’ve come across another similar problem.

Once I select a .csv file (i’ve tried many different types/delimiters etc) I get the ‘Error: Download file is not a .csv’ message, POST data is correct, however the GET response is empty…

any advice you can give?

Hai Vit

I have started yii framework and I did and can able to upload the csv file, I have placed the importcsv folder in protected/modules/ folder. I have run the program and after selecting the file the next button on click is not working.And the Delimiter is enter key not ; (semi colon ) . I am attaching a screen shot for your reference.

Can you please tell me what could be the problem. I could not figure it out how to solve this problem.

Hi together,

I got the same issue as Kevin Tan. I couldn’t saw the importcsv view under:


Got always an 404 Error or Message from Yii:

I created a directory under myYiiProject called upload and in that, another folder named importCsv, like this: myYiiProject/upload/importCsv/

Furthermore, I created one directory: myYiiProject/protected/modules/importcsv/

In here, there are all the files and folders from the downloaded importcsv modul.

In my project I’ve got the urlManager active. The main.php under modules is as followed:




Where as ‘importcsv’ has to be the same name as your directory under the new modules directory.

Some issues from the comments at the extension page were fixed, the last commit on github was in 2012 October 29th.