Forums » issues with importing multiple files

RSS feed for this topic

Info

Tags

  1. Hi,

    I do have a csv file and it looks like this

    title, creator, description, tags, url1, url2
    "Robinson Crusoe", "Daniel Defoe", "A man survives on an island.",
    "book, classic, island", "http://www.disney.com","http://
    http://www.nytimes.com"

    every time, I upload this file, It creates an item with title Robinson
    Crusoe and only one url included.

    i wonder how i can create one item with 2 urls included and if this is
    possible.
    I am using updated version of CSV.

    Thanks
    Nancy

  2. The way the files get handled is a bit different from the other fields -- confusing, I agree.

    I was able to get multiple files to import using just one url column, set up like this:
    "http://example.com/file1,http://example.com/file2"

    hope that works!

  3. patrickmj: I tried this with a test CSV file with no luck. Do you need to set a different delimiter when doing this, something other than a comma?

    The CSV Import interface does allow you to map multiple columns as a "File", instead of using one column with comma-separated URLs, though as nancymou points out, this currently does not import them as separate files. It seems the interface should be updated to allow only one column to be mapped as a File, or the plugin should be updated so multiple columns can be imported as a File.

  4. Huh. Should work with comma delimiter.

    Much agreed about the need for change the interface, at least once it gets working consistently

  5. I rather like the idea of having multiple columns imported as files, instead of putting the files in a comma-separated list and imported under one column. It makes it more explicit that you're importing multiple files, and removes the necessity of separating them by a comma but enclosing the list of files in quotes.

  6. Just double-checked this, and I can import multiple files to an item using "http://example.com/1, http://example.com/2" as you suggested, Patrick. Had a typo in one of my URLs. My apologies.

  7. No worries!

    For that interface, I agree that multiple columns makes sense. It was implemented that way for the exporting from Omeka.net, which completely bypasses the interface. I'll take a look at what adjusting how that interface works would require.

  8. Patrickmj: I found out in import.php in the Csv plugin in _addItemfromRow function there is a for loop

    foreach($fileUrls[0] as $url) and if you remove the [0] and leave it at foreach($fileUrls as $url) that will read the different files from different columns and attach them to a single item.

    I tried to debug using print_r but I could not see any out put in the interface and i did not know how to debug the code to make sure this is the only place to fix or what is the purpose of looping through the $fileUrls[0].

    Thanks for the help
    Nancy

  9. Nice..

    Thank you for your help...

Reply

You must log in to post.