ImportCSV is used for load positions from CSV file to database.
Import occurs in three steps:
Module has 3 modes:
All parameters of the previous imports are saved in a special .php file in upload folder.
Yii 1.1
1) Copy all the 'importcsv' folder under /protected/modules
2) Register this module in /protected/config/main.php
'modules'=>array( ......... 'importcsv'=>array( 'path'=>'upload/importCsv/', // path to folder for saving csv file and file with import params ), ...... ),
3) Do not forget to set permissions for directory 'path'
4) The module is available at http://yourproject/importcsv or http://yourproject/index.php?r=importcsv (depends from path settings)
Total 20 comments
Hi, paskuale
No, it's correct. It's entirely up to your path settings in protected/confing/main.php
Hi for me module is available on http://127.0.0.1/myproject/index.php?r=importcsv
This guide wrote : 4) The module is available at http://yourproject/importcsv (is incorrect?)
thanks
When i try to upload a csv file, i gotten a msg which says:
The requested URL /importcsv/default/upload was not found on this server.
this error seems to be coming from the download.js
any solution to this?
Hello tad,
Thank you for helping me with this extension. If you have time can you please help me with it because I really can't make it work. I downloaded the file then created a modules folder in the protected folder. After that I put the importcsv folder inside the modules then I followed what you told me to create for the path but still I can't access it what is the right code or url for it? If you have time can you please guide me with the steps in making this extension work? Thanks. I am a student right now and don't have much exp with this thanks a lot but we need it for our system. Sorry for the trouble. Sorry if I am asking too much questions God bless :)
Kevin
Hi Kevin,
The path should be the url of the folder where the uploaded file should be placed. I had created a upload/importCsv folder inside the Module/ImportCsv folder and had mentioned this path there. Hope this would solve your problem.
Tad
Hello,
I also want to use this extension but actually I can't make it work. I am new to yii so I am still quite confused with the codes. Well can someone help me to make it work, I followed the steps but I am not quite sure with step 2 what does the path do or what must be the right path I think I am doing it wrong? http://localhost/gxi_sales/gxi_sales/index.php/importcsv/default is the url I use is it wrong? thanks sorry for asking these questions hopefully some one could help. God bless!
Kevin
Hi, Tad.
I wanted to answer to you, but you already solved your problem yourself.)
Thanks Artem, I could resolve my problem. Had not set the url in path variable properly. Its a great extension.
Thanks
Hi, Tad.
You must download this module into protected/modules. No protected/models.
Hi
I am interested in using this extension in my application but getting some errors. I have downloaded the folder in protected/models as stated. In main.php, what should be the path?
Thanks
Hi, giunz.
This list is formed in method "tableColumns" (/protected/modules/importcsv/models/ImportCsv.php). You can exclude this table from array, for example, in "/protected/modules/importcsv/views/default/secondResult.php" str. 35.
Hello, In my database I have a table users where I keep usernames and passwords.Is there a way to exclude that table from the list that gets loaded?Thnx
Thanks
Hi
The idea looks very nice but i haven't tried it yet (Sorry!!) but i'm wondering how does it handle data from related tables ?
Thanks in advance
Hi!
I have an CVS file without a primary key and would like to import the data sets to a table with auto-incremented primary keys (Insert all from cvs into a blank table).
This I leave table pole "id" unassigned. There is no error message after import, but no rows are imported at all.
Is that possible or do I have to introduce an id column to the cvs file?
Sebastian
Thanks for your contribution to Yii! I recommend removing the logic from secondResult.php and the other views and move it to a model.
Hi,
this is a nice interface
I've got some suggestions to improve your model ImportCsv.
it works now :)
Hi, ortenheim.
I corrected this error. Download new version please.
hi i get a delimiter error when installed the module. i have made the folder 777...
Undefined variable: delimiter protected/modules/importcsv/controllers/DefaultController.php(268)
267 $this->render('index', array( 268 'delimiter'=>$delimiter, 269 'tablesArray'=>$tablesArray, 270 ));
how can i fix this problem? (i am using yii 1.1.7)
Leave a comment
Please login to leave your comment.