Files imported are renamed

I would to know if is it possible to maintain the original file name when imported in Omeka.
For exemple, I created a new item, imported a file named bolero.png but the image apperas with the new name 1ad4c7c1900635272b4dae1140fb93c2.png
Is it a way to export the files with their original name ?
Thank you

This may be possible with a plugin and a crafty use of Apache and X-Sendfile, but there is no way to do this with vanilla Omeka.

Hello,
Why is not possible like it is in ResourceSpace and CollectiveAccess ?
When logged as admin it would be great to download the item with its Original File Name.
That's the only missing feature who prevent me to adopt Omeka...
Thank you and regards

Hi,

When you are logged in as an admin and working in the admin (admin/items/show/ and admin/items/edit) you will see that the original file name is present and you can also see its matching archive file name.

The ImageMagick program processes all of the files imported into Omeka to create derivatives that are web friendly, and in the process of doing that renames the files.

While Omeka can be used as a type of DAMS or Collections Management System, it wasn't designed to be either of those types of systems. It is really best as a web publishing tool for digital collections and for publishing different types of digital projects.

Thank you for the answer. I understand better how to use Omeka, but unfortunately for the moment, it don't works for our needs.
Thanks again.

Hi again,

One of our developers was listening in on this conversation and started working up a prototype plugin that would allow you to do just what are you seeking: when logged into the admin side, you can download a file with its original name from the admin/files/show pages.

In its current state, you need access to your Omeka files on the server, then you can edit the admin theme and add a new helper function, which he created, that allows for that download link w/original file name to be available.

Omeka might fit your needs after all.

Hi,

Great news !
Any idea when the plugin will be released ?

> Any idea when the plugin will be released?

We don't know. It's a proof of concept right now, and it requires you to modify your themes to get the desired effect, so it remains to be seen whether this is the best direction for a file download plugin. But, if you're comfortable with git, feel free to clone the plugin repository and help us test it:

https://github.com/omeka/plugin-FileDownload

Use the provided file_download_url() function to create file download links.

Ok, downloaded, installed and activated but I don't see in the admin side where is the download action.
Missing something ?

You need to edit the theme files directly to include links to the file download. For example, in application/views/scripts/files/show.php add the following line:

<p><a href="<?php echo file_download_url($file); ?>">download</a></p>

You can do this on any page where the File record is available.

We are interested in this as well. I am interested in this for another reason. We are using softchalk to create learning packages. These packages would then be linked from LMS systems. They utilize collections of .html files that link to other files through relative linking. I doubt the fix above would allow a file to link to other files within a repository.

Likely I am looking for an on the fly .zip unpackager that links the index.html file. That would work fine as long as the packages were small....

I still miss something, sorry...
If I edit
application/views/scripts/files/show.php add the following line:

<p>">download</p>

Nothing happens and there's no link download.

Sorry, line:
<p>">download</p>

You're munging the markup. Make sure to include the PHP tags like so:

<p><a href="<?php echo file_download_url($file); ?>">download</a></p>

Yes, I did. I just can paste it here on message (??)
But I pasted exactly on the ../show.php and nothing change: in good or bad...

'<p>">download</a

<?php
# --------------------------------------------------------------------------------------------
#
# CollectiveAccess :: Open-source collections management software
# Version 1.0
#
# --------------------------------------------------------------------------------------------
# THE VALUES BELOW ***MUST*** BE CHANGED TO SUIT YOUR ENVIRONMENT
# --------------------------------------------------------------------------------------------

#
# __CA_BASE_DIR__ = the absolute server path to the directory containing your CollectiveAccess installation
#
# Enter the correct directory but omit trailing slashes!
# For Windows hosts, use a notation similar to "C:/PATH/TO/COLLECTIVEACCESS"; do NOT use backslashes
#
define("__CA_BASE_DIR__", "/Volumes/PROMISE PEGASUS/www/collective"); '

The PHP tag are truncated here on message, but is the good one in the view.php page...

You can add code by wrapping it with backticks. I'm confused by the CollectiveAccess code block.

Let's start from the beginning:

* You must be using Omeka 1.5+
* Download the experimental FileDownload plugin here.
* Place the plugin in plugins/, making sure to rename the plugin directory to FileDownload
* Install the plugin as normal
* In admin/themes/default/files/show.php add:
<p><a href="<?php echo file_download_url($file); ?>">download</a></p>
* Navigate to a file show page in your admin interface

If you've done everything correctly, you should see the download link.

It works ! My bad...
THANK YOU !

I just left a post along these lines, then found this. I will give it a go. Providing a download link is 1/2 the battle. Am looking to be able to just reach in and pull the file so it can be played or displayed in a CMS.

Gather this is what the above posters were alluding to... being able to do this ala Youtube and so on. Fundamental nowadays.

The last release of Omeka really took a giant leap forward. Really excellent.

I aadded this plugin and tweek. It is still naming the files with that very long assigned name and not the simple name I want to maintain.

file name: 3c.jpg
imagemagick new name: bd065e1b2f30b9ae37fd694143cb2a01.jpg

I was hoping to maintain the short name.

process I used to add, file was..
login to admin section
naviagte to add item
click on file upload, upload image
image old name is displayed in admin (same as always) however it is still remaned in the archives files path on server.

ANy hope or comments? I followed your instructions fo the plugin/patch
Let's start from the beginning:
ie.... (sthe follwoing) had no issues or erros reported.
* You must be using Omeka 1.5+
* Download the experimental FileDownload plugin here.
* Place the plugin in plugins/, making sure to rename the plugin directory to FileDownload
* Install the plugin as normal
* In admin/themes/default/files/show.php add:
<p>">download</p>
* Navigate to a file show page in your admin interface

so close but yet missing a key item that I would reallylove to see....

Joe.
PLEASE Keep up the great work on this program. I love it. only 3 days into using it at http://www.rvv.com/collections.

@jpcohen This plugin works fine, but it is only used to export images with the original name, not to upload and to keep them in the Omeka base with the original name.

Hi,

I made a plugin that allows to keep original file names: see https://github.com/Daniel-KM/ArchiveRepertory

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Daniel,
I've tried to use your plugin without luck. I have allways an error on import file process. Any idea ?

Hi,

Thanks for using the plugin and your report.

In order to investigate, I need some infos:
- What are your messages of error?
- Are your files well imported (look inside your archive folder)?
- Do you import files via the "add content", CsvImport plugin or via a specific way?
- Are original files reachable by your server?
- Do you use collections?
- What are the parameters of the plugin?

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi,

Last thing: this plugin needs a very small patch on Omeka core to be used. See readme file and the patch https://github.com/Daniel-KM/Omeka/commit/f2ac2f50f3219973a228ecc2db52a676a852e743.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,
Thanks for your help. I've give a try again today, following yours advices, with errors again.
Here's the log :
2012-10-28T10:48:39+01:00 ERR (3): exception 'Omeka_Storage_Exception' with message 'Destination directory is not writable: '/var/folders/7b/yn942v0j3gs_xb3y3f5s60r80000gn/T'.' in /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Storage/Adapter/Filesystem.php:203
Stack trace:
#0 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Storage/Adapter/Filesystem.php(131): Omeka_Storage_Adapter_Filesystem->_rename('/var/folders/7b...', '/var/folders/7b...')
#1 /Volumes/PROMISE PEGASUS/www/omeka/plugins/ArchiveRepertory/plugin.php(213): Omeka_Storage_Adapter_Filesystem->move('91018dfeda2c1be...', 'Double Clusters...')
#2 [internal function]: ArchiveRepertoryPlugin->hookBeforeInsertFile(Object(File))
#3 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Plugin/Broker.php(156): call_user_func_array(Array, Array)
#4 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Plugin/Broker.php(182): Omeka_Plugin_Broker->callHook('before_insert_f...', Array)
#5 [internal function]: Omeka_Plugin_Broker->__call('before_insert_f...', Array)
#6 [internal function]: Omeka_Plugin_Broker->before_insert_file(Object(File))
#7 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Record.php(304): call_user_func_array(Array, Array)
#8 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Record.php(540): Omeka_Record->runCallbacks('beforeInsert')
#9 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Record.php(581): Omeka_Record->save()
#10 /Volumes/PROMISE PEGASUS/www/omeka/application/models/Item.php(303): Omeka_Record->forceSave()
#11 /Volumes/PROMISE PEGASUS/www/omeka/application/models/Item.php(239): Item->saveFiles()
#12 [internal function]: Item->afterSave()
#13 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Record.php(282): call_user_func_array(Array, Array)
#14 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Record.php(566): Omeka_Record->runCallbacks('afterSave')
#15 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Record.php(807): Omeka_Record->save()
#16 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Controller/Action.php(419): Omeka_Record->saveForm(Array)
#17 /Volumes/PROMISE PEGASUS/www/omeka/application/controllers/ItemsController.php(133): Omeka_Controller_Action->addAction()
#18 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Zend/Controller/Action.php(516): ItemsController->addAction()
#19 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('addAction')
#20 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#21 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#22 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#23 /Volumes/PROMISE PEGASUS/www/omeka/application/libraries/Omeka/Core.php(165): Zend_Application->run()
#24 /Volumes/PROMISE PEGASUS/www/omeka/admin/index.php(44): Omeka_Core->run()
#25 {main}

When your plugin is activated, no file is imported. When deactivated, files are imported.
I import via "add content"
The files are normally reachable by the server , at least when the plugin is deactivated
I use collections

Parameters of the plugin :
Add a folder for each collection - checked
Keep original name of attached files - checked
Keep only base of original name of attached files - checked

Thnks for your help

Daniel, forget to say: collection's folders are well created.

Hi,

The plugin tries Omeka_Storage_Adapter_Filesystem->move('91018dfeda2c1be...', 'Double Clusters...'), but it cannot write inside 'Double Clusters...". The problem is "Destination directory is not writable".

What is 'Double Clusters...' ? A folder that the plugin created or something else?

I use my plugin on a normal server (an Apache one) and you seem to use a different one. Do you use a cloud service? I didn't check yet my plugin on this type of server. It it's the case, pehraps I'll need to change some code to manage them.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Daniel,

I tried to install your plugin today. When I activate the plugin, I get the following error message displayed on every page of Omeka:

Parse error: syntax error, unexpected T_FUNCTION in /home/stmarylaw/stmarylaw.org/plugins/ArchiveRepertory/plugin.php on line 371

I made the two modifications to the core, but I get the same error no matter what page I go to. Am I doing something obviously wrong?

By the way, having a plugin that keeps the file names and structure will be very good. I hope I can get this working.

-Wilhelmina Randtke

OK, here's clarification: Clean URL is working. ArchiveRepertory is not and gives me the error message.

-Wilhelmina Randtke

Hi,

The bug you get is different from lindes' one. Yours means that you are not using PHP 5.3,

So you can upgrade your installation or try the patch I will make this evening to be compatible with all PHP 5 versions.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

I also tried your plugins a couple of months ago and ther are really great! Many thanks for sharing this.

I left a message in github with another issue that I noticed for both of your plugins (CleanURL and ArchiveRepertory). When I try to uninstall them, it gives a fatal error. It is only possible to deactivate but not unistall.

I have installed CleanURL and works really well. Archive Repertory were giving me problems and I stopped using it (sorry, donĀ“t remember now which were the issues).

Regards and thanks again,
Dani

Hi,

@Wilhelmina Randtke: I updated the plugin to be compatible with PHP 5.0 and not only PHP 5.3. You can try it. For CleanUrl, the plugin works fine. Last things to implement is to replace the default url with the customized one in order to display only the good. This is not a big issue, because it's simple to build the customized from any item.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi,

@danimon: The uninstallation has been fixed on the 28th september. it was due to a core bug.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Thank you! This is working great now.

Also, by assigning items to an embargoed collection, manually putting an htaccess file into the folder for the embargoed collection, then the items to a different collection later, I can embargo journal articles. I can also designate some collections for on campus use only, by manually putting an htaccess file into the folder.

So, it lets me keep my file structure from causing problems with too many files, and also lets me control access.

-Wilhelmina Randtke

Hi,

I have just started using Omeka and this was for me one of the biggest issues so far, not being able to keep the original file name (at least without going to the administrative panel).

I was also worried about the files being stored in the same folder and I have already about 2000 items to upload (image, video, text) but this number will grow in the future.

From what I understand this pluggin seems to solve these issues... though I didn't see this pluggin in the pluggins page. This should definitelly be there!

Filipe

Just realized this is for the Omeka 1.5 version...

Anyone knows if and how I can do this in the new Omeka version?

Thanks!

Filipe

You might want to go to the plugin developer's github repository and ask there: https://github.com/Daniel-KM/ArchiveRepertory

Hello, thanks, I will. I asked here because I saw the creator had been to this forum thread.

Also I wanted to know if there is any other way to do this in Omeka 2.0 if this pluggin is not adapted to this version...

Thanks.

Filipe

The original file names are still visible in the admin and public sides, and when plugins such as the Dropbox are installed.
The original file names appear as alt-text when hovering over files on the public site. But derivatives are still made and that new file is what is referred to in the /files/original/ folder.

Hi,

Upgrade of Archive Repertory plugin for Omeka 2 is done.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Thanks Daniel!

To help people find it, do you want to add it to the list of plugins on omeka.org?

Hi,

Yes, you can (and other plugins if needed).

Note that currently, two lines should be changed in Omeka core. See patch here and explanation here.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management