CSV Import : what path to local files?

Hello,

I’m trying to import data from a CSV file and it appears that all item are skipped, because each path to files are wrong I presume.

It’s a local Omeka. For example a path like C:\wamp64\www\omeka\files\import\images-FR075FMSH_000000051\art003-008FR075FMSH_000000051_8D3_art003-008_001.jpg doesn’t work.

Should I use another syntax for this path?

J.

Local paths are forbidden for security. They may be allowed for a specific directory in my fork Csv Import Plus.

Thank you very much,

I installed this plugin and I’m learning how to use it.

I’m trying to construct good path and would take the opportunity you are “here” to ask you a precision: if i put all the files in the same directory “C:\wamp64\www\omeka\files\import”, should I specify this path in the parameter “local_folders.base_path” of the security.ini file?

Yes, you should specify your base path in the file “security.ini” of the plugin. This is where the security occurs : users can’t access other files or the system. This is not in the config page, so I’m sure that only people who have access to the system can change it.
Next you put all your files inside it, with or without subfolders, as long as the paths are set in your csv.

Thank you,

Then when I load the CSV file, I set the corresponding field to map to “local URL” element, with the special value “files”.

The import fails and I get this message:

 	Invalid file URL "C%3A%5Cwamp64%5Cwww%5Comeka%5Cfiles%5Cimport%5CFR075FMSH_000000051%5Cart003-001%5CFR075FMSH_000000051_8D3_art003-001_001.jpg": C%3A%5Cwamp64%5Cwww%5Comeka%5Cfiles%5Cimport%5CFR075FMSH_000000051%5Cart003-001%5CFR075FMSH_000000051_8D3_art003-001_001.jpg is not a valid URL. 

The CSV file is UTF-8 encoded but I guess there’s something I’m doing wrong because of some characters of the URL.

Because it is possible to import anything with Csv Import +, the headers of the csv are slighty different. See an example here https://github.com/Daniel-KM/CsvImportPlus/blob/master/csv_files/test_manage_one.csv.

Thank you,

I looked at the examples, indeed it’s possible to import whatever you want, that’s great.

The problem is some characters of the URL are converted, which means that the URL becomes wrong and the rows of the file are skipped.

For example “c:'wamp64” became “C%3A%5Cwamp64” .

Omeka is designed for a lamp stack, and I don’t see Windows since a long while, so I can’t check it.
Anyway, you don’t need to set the full path, only a relative, for example “my/files/folder/myimage.jpg.”

I resolved the problem of character encoding but the path is still wrong.

Concerning the column containing each URL, can you confirm me that I have to set parameters “map to element” on “Local URL” and “special values” on “files”?

These columns don’t exist on my fork.

So you use manual mapping.

If this is the column where there is the path, you have to choose special values / files. The “Local url” is a field like any other ones, but doesn’t upload anything.

Maybe there’s a misunderstood : here is a screenshot of what I was talking about.

The column “Fichier” should be mapped with “Special values” / Files only. You don’t seem a value to use with the element “Local Url”.

Unfortunately the records are skipped because of “invalid file URL”. I’m unable to find the good path syntax , either an absolute or a relative path.

I think it’s time to give up and maybe to find another way to test Omeka.

I successfully used the CSVImportPlus plugin to import image files which are located on an HTTP server. Now I try to import files that are located in a local path.
I configured the security.ini file as follow:

local_folders.allow = true
local_folders.check_realpath = true
local_folders.base_path = '/tmp/images'

However, when I try to import, I still get the following error message:
Local paths are not allowed by the administrator (image-test.jpg) [no scheme].

Do I have to configure something else?

Try to set false the option “local_folders.check_realpath”, this may avoid error on some custom servers or with some configurations of Apache. Check the rights of the server to access inside this repository too.

Else try to create a folder like “uploads” inside the standard “files” folder of Omeka.

I tried your first solution: set to false the option “local_folders.check_realpath”. No success.

Then I tried to create a new “uploads” folder inside the standard “files” folder and gave proper access rights to the server. Still no success. I even tried to set false and then true to the option “local_folders.check_realpath”. Still no luck. I always get :
Local paths are not allowed by the administrator.

The first line in security.ini [csv-import-plus] should not be modified.

Else, I don’t see. You can simply hack it: add “return true;” line https://github.com/Daniel-KM/CsvImportPlus/blob/master/models/CsvImportPlus/Import.php#L2080. Or debug it here if you have some time.

You may have to enter the full path of the images too in the csv.