Changing Path of Download/View File

46 views
Skip to first unread message

Khairunnisah

unread,
Sep 6, 2022, 3:03:36 AM9/6/22
to AtoM Users
I want to change path of download file such as pdf, video, img etc. The path of download file for example accesstomemory.org/uploads/r/atom/9/9/3/.
What php file should I change to do this and where is the location?

Dan Gillean

unread,
Sep 8, 2022, 9:07:25 AM9/8/22
to ICA-AtoM Users
Hi there,

Sorry for the delay. I will ask our developers if they can try to point you to the right files to modify. 

In the meantime, you may find the following documentation page helpful in providing context: 
This page outlines how the uploads directory is currently typically organized, and why: 

For each uploaded or linked object, AtoM will add a SHA-256 hash of the object and then, to avoid collisions and aid in retrieval, it will create a specific set of subdirectories based on this hash - 3 subdirectories named after the first 3 characters in the hash, followed by a final nested subdirectory named after the remaining hash characters.

I will follow up with further information from our team soon to help you find the relevant code. 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


On Tue, Sep 6, 2022 at 3:03 AM Khairunnisah <anrikhai...@gmail.com> wrote:
I want to change path of download file such as pdf, video, img etc. The path of download file for example accesstomemory.org/uploads/r/atom/9/9/3/.
What php file should I change to do this and where is the location?

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/8a690a5b-a56e-4ded-9e9b-fbd460e5e0c3n%40googlegroups.com.

Dan Gillean

unread,
Sep 9, 2022, 9:09:16 AM9/9/22
to ICA-AtoM Users
Hi again, 

As noted in the link I shared last response, the uploads directory is typically found just below the root AtoM installation directory - so if you followed our recommended installation instructions, the uploads directory will be found at /usr/share/nginx/atom/uploads

If you are trying to move the entire uploads directory, the easiest way to do this without requiring code changes would be to simply use the unix mv command to move it wherever you'd like, and then create a symlink to it from AtoM's root directory. 

If your goal is to change how the uploads directory is organized and how the subdirectories are created, please note the original purpose I listed last time - to avoid collisions: 

For each uploaded or linked object, AtoM will add a SHA-256 hash of the object and then, to avoid collisions and aid in retrieval, it will create a specific set of subdirectories based on this hash - 3 subdirectories named after the first 3 characters in the hash, followed by a final nested subdirectory named after the remaining hash characters.

 Meaning: if you change this, you will need to ensure that you are maintaining unique digital object filenames per repository in some other way to avoid issues. 

If you want to change the way that file paths are generated for new uploads, then I believe the place to look will be the getAssetPath function in lib/model/QubitDigitalObject.php. Here it is in the current stable/2.6.x branch: 
Specifically, I think line 1900 is creating the hashed nested directory path: 
  • return '/'.QubitSetting::getByName('upload_dir')->__toString().'/r/'.$repoDir.'/'.$checksum[0].'/'.$checksum[1].'/'.$checksum[2].'/'.$checksum;

Good luck!

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him

Khairunnisah

unread,
Sep 13, 2022, 11:12:04 AM9/13/22
to AtoM Users
Hi Dan, 

I just want to change file for viewing document, video and image. So, I don't wanna change file for uploading and generating file paths.
I already tried to change several file that I suspect to view document. But, it seems I haven't found the right one till now.
Reply all
Reply to author
Forward
0 new messages