We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14214
    • 299 Posts
    Am working on a project where I need to provide users access to a technical library. In total there are about 3700 files of different formats and groupings. Most of these are PDF’s although there are a few text files and PowerPoints.

    What is the best way to display these files for the site visitor so they can download them. The files need to be searchable through whatever search method is used on the site (currently AjaxSearch). I’d like to find some method of making these files accessible other than manually creating 3,700 docs or links. Any advice? Have you run into similar situations?

    Thanks in advance for the help.

    Jisaac
      • 14214
      • 299 Posts
      Have searched and searched - still nothing. Anyone?
        • 3749
        • 24,544 Posts
        When you say searchable, do you mean the content of the files or just the filenames?

        As far as making them downloadable, a snippet that reads the directories, makes an array of the filenames, and then creates the appropriate links might do what you want.

        I have a snippet around somewhere that reads the files from a single directory, sorts them, and makes links to them for download. I could try to locate it if you think it would help.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 14214
          • 299 Posts
          Quote from: BobRay at May 11, 2010, 10:32 PM

          When you say searchable, do you mean the content of the files or just the filenames?

          As far as making them downloadable, a snippet that reads the directories, makes an array of the filenames, and then creates the appropriate links might do what you want.

          I have a snippet around somewhere that reads the files from a single directory, sorts them, and makes links to them for download. I could try to locate it if you think it would help.



          Huge bonus if the the content is searchable. However, the real need is just the file name. All of the files have the necessary information in the file name.


          In the repository there is a FileDownload snippet however that information is not searchable.

          I’d appreciate trying the solution you suggested.

          Thanks,
          Jisaac
            • 3749
            • 24,544 Posts
            I looked a the FileDownload snippet and I’m afraid that there’s nothing my snippet does that the FileDownload snippet doesn’t do better (except a custom sort by year and month, which you wouldn’t want).

            Neither my snippet, nor the FileDownload snippet have any search capabilities. I’m afraid that would take some custom coding on your part.

            Sorry I can’t be more help. Maybe someone else will have a suggestion.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 14214
              • 299 Posts
              Quote from: BobRay at May 12, 2010, 12:39 PM

              I looked a the FileDownload snippet and I’m afraid that there’s nothing my snippet does that the FileDownload snippet doesn’t do better (except a custom sort by year and month, which you wouldn’t want).

              Neither my snippet, nor the FileDownload snippet have any search capabilities. I’m afraid that would take some custom coding on your part.

              Sorry I can’t be more help. Maybe someone else will have a suggestion.

              Will the links created by your snippet be found in a AjaxSearch search? Because that really is the main goal. To have a visitor locate a file along with other docs when running a site search.
                • 3749
                • 24,544 Posts
                Quote from: jisaac at May 12, 2010, 01:06 PM

                Will the links created by your snippet be found in a AjaxSearch search? Because that really is the main goal. To have a visitor locate a file along with other docs when running a site search.

                TBH, I’m not sure. I’ve never used AjaxSearch. If the page is cached and AjaxSearch searches the cache, it would be found -- otherwise not because the links are created dynamically and would not be in the DB.

                If AjaxSearch does search the cache, the FileDownload snippet would still almost certainly be a better choice. If it doesn’t, your only choice (short of creating a document for each file) would be to create a custom search function that reads the directory(s) into an array, searches the array, and creates the appropriate links. Not a trivial job, but it could definitely be done.

                I guess you could also create a custom DB table containing each file name and a link to it (and maybe a few key words from the content) and search that, although keeping it up to date might be a challenge.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 14214
                  • 299 Posts
                  Looks like I’ve got some research to do!

                  Do appreciate the help. I’ll look into the possibility of searching the cache.