Removing CSV Import Media File Label

We batch imported a set of records through CSV import. The image files were ingested by pointing to an external public URL. Initially, we didn’t assign the image file to any DC field. In the fields mapping stage, the image URL field in our CSV file was selected as a Media Import, then by URL.

After the import successfully completed I noticed that in the record for the new items the image source URL was used as a label for the image. This is of course not ideal since we don’t want a big URL string showing up in the public record as a label for the image that points to what will be the old location of the file (which is designated for removal).

I tried to test this with another import that mapped to a dc field. My hope was that I could then remove the lable through the batch edit process. But it seems like the label isn’t connected to the dc field.

Here is an example.


Is it possible to ensure through csv import that when you you are importing files from an external URL that the import doesn’t use the url as a label for the file? Could we have it blank or be able to delete it through a batch process after? I know that you can edit the media labels item by item, but I don’t see any option at the batch level.

Thanks so much!

You can hide it in your theme, or set a specific dcterms:title to your file.

We could do a display none but I was curious as to whether we can have better control of what happens with the media label on import if possible. I’d rather it not grab the URL being pointed to for the import as the default label.

The item has a dc:title already. In the test example it is “Leddy Library”. I didn’t want map the URL column in the csv to both a Media import via URL and to dc:title as I wasn’t sure how that would interact with the existing dc:title given in the csv file. Also, I did map it to another dc:field I wasn’t using with a plan to just batch clear that field. However, the media label isn’t affected by mapping to another dc field. It still just grabs the URL you’re importing from and uses it as a label for the image. The image label doesn’t appear to be controlled by anything in the field mapping process in csv import. I’ll try this again to see if the result is different if I choose other dc fields.


So in your case, it’s only a theme related issue.

Thanks Daniel. It does relates to how the class “resource-name” is populated during a cvs import for image files that are ingested via URL in a csv import. I apologize if that is better suited for another section. I’m assuming then thatthis is the expected behaviour for csv import and there isn’t a way for a user to change that behaviour at present, and while there is a way to manually adjust this item by item there within omeka these is no batch process for revising this.

There is a new feature that is available in my Omeka S dev version and that will available in the next release of Omeka S (see that allow to edit media properties in bulk.
But in your case, a specific filter is needed, because to keep only the basename is a specific feature that doesn’t exist in csv import or in the core methods (the same occurs when you import manually a file for an item), if I understand that it is what you want.

Thanks! I believe that would be exactly what we’re looking for.

Not sure if you’ve resolved this, but if you have SSH access you can eliminate the URL prefix using the following SQL statement:

UPDATE media SET source=REPLACE(source,'http://youruploadurl/','');

I should clarify that you have to indicate the database you wish to chance first with:

USE databasename;

‘media’ indicates the table, in this case the one called media, and ‘source’ indicated the column.