LetoDMS Community Forum
Using NAS - Printable Version

+- LetoDMS Community Forum (https://community.letodms.com)
+-- Forum: Customization (https://community.letodms.com/forumdisplay.php?fid=5)
+--- Forum: Addons/Mods (https://community.letodms.com/forumdisplay.php?fid=14)
+--- Thread: Using NAS (/showthread.php?tid=95)



Using NAS - Vault - 06-28-2010

Hi,

i'm in a windows environment, using a NAS as Storage.

My NAS is named 'nas1', and if pointing to that nas like '//nas1/dms/documents/' (UNC-Naming) some strange things happen and an error occurs, no document is stored while uploading, resp. stored in the app-path itself?

So i modified the 'inc.FileUtils.php' reading like this:

************************************************
function makeDir($path)
{
#modification start
if(substr($path,0,6)=='//nas1')
{
mkdir($path,0777,true);
return true;
}
#modification end


if (strncmp($path, DIRECTORY_SEPARATOR, 1) == 0) {
$mkfolder = DIRECTORY_SEPARATOR;
}
else {
$mkfolder = "";
}
$path = preg_split( "/[\\\\\/]/" , $path );
.....

************************************************

Ok, i first want to hear if this isn't good using mkdir this way.
If no complaints than i will do some more work on it.

Regards


Jörg


RE: Using NAS - matteo lucarelli - 07-15-2010

It seems like you patch will work only for your specific case (the path must start with "\\nas1") Can you provide a more general patch (or at least test deeply the problem)?

What kind of strange thigs happens?

Could ths problem be due to the "\\" starting path? In this case the problem should affect every windows share.

I don't use NAS but don't think they're so different from a regular shared partition.

Let us know,
Matteo


RE: Using NAS - Vault - 07-15-2010

Hi matteo,

as i wrote it wasn't possible to point to an other Resource using an UNC-Path like '\\nas1\dms\documents\' or '//nas1/dms/documents/'.

The first two slashes have been handled not correct, so at the end my documents resided in the path of the installation of my dms, locally, beneath
a 'nas1/dms/documents/1048576'-Folder, and so on.

You understand?

The documents were not saved on the NAS but locally!
It worked out that the saveing-routine has a problem, the (i call it) path translation in it.

And, of course, they will never be found, because reading the documets the path points to the NAS, but no documents there!
And the reading routine does no path-translation.

And, of course, the code i posted is absolutely specific to me.
I posted it to demonstrate what happend at my side.

And the question was why not use 'mkdir($path,0777,true);' at all, but juggling with every single folder in the path while saving.

So, i would like to replace the makeDir-Function like this:


function makeDir($path)
{
mkdir($path,0777,true);
return true;
}



Regards

Jörg