Was this page helpful?

Locate attached files on disk on the server

    Table of contents
    No headers

    MindTouch 2009 (9.02) introduced an optimized way to store files for better performance, scalability, and accessibility.  To retrieve the file in the server storage follow these steps:

    Obtain the URI for the file through the browser by hovering over the attachment at the bottom of a MindTouch page or by opening the file in a new browser window.  Within the URI, you will see the file id which is bolded and highlighted in the following example:

    http://yourmindtouch/@api/deki/files/1163/=yourfile.txt

     

    From here you would take the fileid and look up the resource id for the file in the database by running the following query, replacing the 1163 which is the file id in our example with your file id.

    select resource_id from resourcefilemap where file_id=1163;

    This will then return a similar output (note that the resource_id will vary):

     

    With the resource_id you can now determine the folder that the attachment lives in.  If the resource_id is less than 1000 then the folder that the file lives in is that number.  If the resource_id is equal to or greater than 1000 then you will use the following mapping to find the folder it lives in:

    1234 => 123/4.res

    123456 => 123/456.res

    1234567 => 123/456/7.res

    In our example the resource id is 1134.  When we apply the formatting above then we would get the following:

    1134 => 113/4.res

    You can now go to the filesystem(on Linux: /var/www/dekiwiki/attachments  on Windows: C:\Program Files\MindTouch\MindTouch\data\files) and find the folder 113 and then go into the folder 4.res.  You will then see the file 1.bin.  This is the file.  The reason why we rename the file to a generic .bin file is to avoid conflicts with filesystems because of the attached file name as users can have pretty creative file names that in turn can cause issues with certain filesystems when trying to access them.  So the last think you have to do is rename the file 1.bin to yourfile.txt and you will then have your full file.  

    You can read more about the setup and methodology behind this in the specs.  

    Note that you can still access your files through the front end by saving the file to your computer through the browser's save as dialog.

    Was this page helpful?
    Tag page

    Files 1

    FileVersionSizeModified 
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by