• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

[SOLVED] Symlink file upload error

Joomla is on Win2012 R2, XAMPP.
I created a symlink like so:

C:\Users\Administrator>mklink /D "C:\xampp\htdocs\pdf" "Z:\"
symbolic link created for C:\xampp\htdocs\pdf <<===>> Z:\

When I point the file upload element to the above directory, and I try to add a new record, there is the following error:
JFolder: :folder: Path is not a folder.
Needless to say that even though it shows the form, it doesn't save it.

I did this so that I can save the PDFs on a LAN location.

I basically spent the whole day looking for a solution on stackoverflow. Any thoughts?
 
Unfortunately, there's not much I can do about this. J!'s JFolder library uses PHP's is_dir() to check if a folder exists, and is_dir() doesn't understand Windows symlinks. The only way to get PHP's is_dir() to work with a Windows share is to use the UNC path, like '//server/path/to/folder', which obviously doesn't fit with the way Fabrik / J! builds paths relative to the J! root.

Afaik, it works on UN*X. I've not tested network shares on symlinks, but I've used symlinks to point to folders outside of the web root, and those work on Linux. But Windows symlinks are a mess, and just don't play well with PHP.

There's a chance I could re-write out file system adapter in the upload element to avoid using JFolder, but at the moment I have no way of testing it. I've been fighting for a year now with Windows 10 on my laptop and my server, to get network shares mapped. When they did away with the "home group" in Windows 10, it completely screwed up my networking. I've spent countless hours trying to get my laptop to be able to map shares from a Windows 10 Pro server (mostly acts as my media server), with no luck - and judging by the thousands of threads out there about the same issues, I'm not the only one.

-- hugh
 
So, ironically, I suspect that if you ran your J! in a Linux VM in something like VirtualBox, instead of native, using Samba to map your shared drive, it would probably work. :(

-- hugh
 
Thanks Hugh, indeed, I saw on some answers that linux had that. I guess I have to make that PHP upload form after all. I'll use the secondary MySQL table to point to PDFs.
But first, I'll try to comment out the is_dir() in Joomla, and see if it will work.

Thanks again for the help.
Best wishes.
 
I strongly advise against commenting that out in the J! folder library, as it could have some nasty side effects.

If I get a little time in the next day or two, I'll see if there's some way I can finagle testing this. There must be SOME way I can test. Maybe if I just test with a simple symlink to a local folder. Thinking about it, for the purpsoes of this test it shouldn't matter if the target of the symlink is local or a network share.

-- hugh
 
Yeah, I had the same thought when I saw how deeply integrated it was, I will not be doing it.
Maybe if I just test with a simple symlink to a local folder. Thinking about it, for the purpsoes of this test it shouldn't matter if the target of the symlink is local or a network share.
Thank you. If there is anything I can do to help let me know.

I just tried mklink /J (junction directory) which does work, without any problems. I successfully pointed to a local folder C:\test1 and all the uploaded files are there. I guess this is useful to people who use external HDDs attached to the server

I'm still looking for a way to upload to a network drive.
 
Hugh, I did it!!!
Praises to:
https://stackoverflow.com/questions/21616431/using-mklink-command-with-network-drives
(I also did the suggestion n. 2 of the post first
fsutil behavior set SymlinkEvaluation L2R:1
so I'm not sure if it will work without it)

Like he said, just create 2 symlinks in Windows! :D
mklink /D D:\shareLink \\network\share
mklink /J D:\junctionLink D:\shareLink

In my case, I created a /D link to a linux server on a local network that the account can access
and
create a /J link to that /D link pointing to a htdocs/joomla/pdf
and all you have to do at the end is to say element - file upload, destination /pdf
and it works!!

If users follow these simple instructions, they can save and retrieve all their files on any server they want.
:):):)

Be very very careful when removing the symbolic links in Windows!
ref: https://superuser.com/questions/167076/how-can-i-delete-a-symbolic-link
You have to use rmdir for links created with /J, otherwise if you delete them with a "del" key, the directory and its files will be deleted.



Should I document this in the wiki?
 
Last edited:
Yay!

If you feel super helpful, maybe you could add a section to the upload element wiki about that?

I actually just came here to suggest that approach. I tried using a symlink to a local folder, and it worked, then some more googling turned up the same Stack Overflow thread you found. I just couldn't test it, as I still can't create network shares to my server. I can access \\server\path as a UNC, but it stubbornly refuses to let me create an actual drive share.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top