Ok, not being a Unix or PHP guru (yet!) it took me a little while to figure out how to import multiple files into Matrix using the command line. For others about to do same here are the steps:
1)create a folder on your server, "import" for example
2)inside that folder create a folder with the name of the asset ID you would like the files to import to. So for example, if you have a folder in you asset tree with ID 899, name the folder 899
2.5) add the files you wish to import into this 899 directory(in your case, your asset id#)
3) navigate to matrix_install_path/scripts/import/
4)run the php script import_files.php with the following params:
For those twits like me that got sidetracked trying to install the cli version of php - first check that it is not already installed! I did this on RHEL4 with the command
php-cli -v
If you get a response - you are good to go. Substitute php-cli for php in the example scripts above.
[quote]Correct, I’ll look in the folder specified and see the 888 sub folder and interpret that as the asset ID to import into
[right][post=“10518”]<{POST_SNAPBACK}>[/post][/right][/quote]
Ass long as you have created the parent asset ID folder etc, all will work.
You may also want to check the php script execution.
importing a couple of hundred files took a couple of goes the first time…
[quote]For those twits like me that got sidetracked trying to install the cli version of php - first check that it is not already installed!
[right][post=“10504”]<{POST_SNAPBACK}>[/post][/right][/quote]
On your server, we installed the Squiz PHP CLI RPM (part of the service). RHEL4/CentOS does not ship with a php-cli binary by default.
[quote]importing a couple of hundred files took a couple of goes the first time…
[right][post=“10519”]<{POST_SNAPBACK}>[/post][/right][/quote]
Yeah, you may need to set a much higher memory limit, particularly for mass importing PDF or Word documents. Remember, Matrix has to index them all during the import, which requires memory.