Retaining original filename after upload
I have recently moved our forum from naturnettet.com (ver. 2.1.8) to naturnettet.net (ver. 2.6.4).
I used to:
1) retain the original filenames after upload, and
2) save all uploaded files (jpg photos) in a separate folder for each member (.../uploads/photos/#memberID)
As a default, filenames are changed and every image uploaded seems to be placed in a new folder.
Where can I define/change these two conditions so that we can continue as before?
I believe that I made changes in core files (!) in the previous version but due to lack of programming skills, I am unable to find where and what to change.
In the library/core/class.upload.php it says: "237 - If there is a plugin that wants to store uploads at a different location or in a different way then they register themselves by subscribing to the Gdn_Upload_GetUrls_Handler event." but I haven't been able to find such plugin.
Can anyone explain how this can be done?
Comments
Both requests can be made possible but are not trivial and there normally is no need for that. Why should anybody care how files have been saved? What is the purpose of that request?
If you just want to see those files, maybe showing a list of them somewhere:
We are photographers and use the forum to present photos and descriptions of what we see in nature - butterflies, birds etc.
When I upload photos in different threads (discussions) all of them will be saved in the same folder.
This we have done since 2009 (Vanilla 1 forum) and from 2015 (Vanilla 2) - but still, all my photos are saved in the same folder. This means that when visiting our website (naturnettet.dk) and clicking "Forumgalleri" and further clicking my name all my photos will be shown - direct link: http://naturnettet.com/2/uploads/forumbilleder/1/forumgalleri4.php - and likewise for all other members.
By keeping the original file name, the species and date etc. is directly shown and the EXIF data will tell the details of the camera settings etc.
@R_J
When I had the identical problem in 2015 it was solved by changing the ImageUpload plugin to the following:
<?php if (!defined('APPLICATION')) exit();
$PluginInfo['ImageUpload'] = array(
'Name' => 'ImageUpload',
'Description' => 'lightweight and simple image uploader',
'Version' => '1.1.1',
'RequiredApplications' => array('Vanilla' => '2.0.18.4'),
'RequiredTheme' => FALSE,
'RequiredPlugins' => FALSE,
'MobileFriendly' => TRUE,
// 'HasLocale' => TRUE,
'RegisterPermissions' => FALSE,
'Author' => "chuck911",
'AuthorEmail' => 'contact@with.cat',
'AuthorUrl' => 'http://vanillaforums.cn/profile/chuck911'
);
class ImageUploadPlugin extends Gdn_Plugin {
}
Since then (ver. 2.6.4) the function UploadImage can be found in .../library/core/... not just as a plugin.
The ImageUpload plugin can still be chosen in the Dashboard/settings but even if I can see in config.php that the plugin is enabled:
$Configuration['EnabledPlugins']['ImageUpload'] = true;
it doesn't work. Even if Advanced Editing is disabled and the upload button becomes active a click there just opens the proper folder on my PC, I can choose the picture that I want to put into my comment but no picture is uploaded.
Is the ImageUpload plugin incompatible with Vanilla 2.6.4 or is something missing somewhere in e.g. config.php?
I hope that there is an easy solution to the problem - the plugin worked perfectly in Vanilla 2.1.8!
@R_J: Also for Image-SEO reasons keeping files names can be crucial.
Oh yes: DSC001.jpg
But for a nature forum it makes perfectly sense having photos named "nice_butterfly", I certainly agree.
Like this:
Gonepteryx rhamni 20170825-21742-900.jpg
species - date - picture# - size (width px)