I have set up a script on my page which automatically reads the files in a specific directory on the server and displays them in a nice file tree on my website so users can download the files. Here is the script: http://abeautifulsite.net/blog/2008/...ery-file-tree/
The plugin is working fine as far as finding the files and displaying them. However, the root folder where the files are stored is not the directory you would go to to access the actual files.
"You might have to write a function to parse the filename that it passes and make some adjustments so it redirects to the right file on the server, but it will work."
I'm probably just not explaining myself very well. Or it could be I went about it all wrong to begin with. LOL
The jquery file tree automatically grabs all of the files in the specified directory for me. So I do not have to do ANY coding when I add files such as meeting minutes, etc. All I do is upload it to to the server and it is automatically displayed in a nice little file tree for the user to download.
But you have to specify the full root in the code which is not the same path that you would use to access the file.
For example,
my index page is /home/cityofligonier/index.html
I have temporarily solved this problem by copying all of the files from /files/documents_and_forms/ to /home/cityofligonier/files/documents_and_forms.
However, this is not ideal because now I have to upload each new file to two different directories.
It would be nice if there was at least a way to automate that process. Can you sync two folders on a remote server? So everything I upload to one directory automatically gets copied to the other?
I registered for this site just to help you out. I too just implemented jquery file tree on a site and ran into the same problem you have. I am not a web developer/programmer, but I work with one and he was able to help me so I am passing it on to you. It is a simple fix.
@Any of the OPs in this thread: I have same problem except for one thing. Nowhere in my javascript is there a piece of code that matches "window.location = file;". SO I don't know where to apply the fix! I am using (as near as I can tell) the same code from abeautifulsite.com. How can it be so different? I have the identical problem that fought70 was having. Any suggestions would be seriously appreciated! -c-
Bookmarks