3 Replies Latest reply: Jul 11, 2007 8:54 PM by Chuck1411 RSS

    Opening File

    AidanGuy
      I have a list of documents displayed in a grid and want to be able to open the files (which are stored on the webserver). The files have different file types.
      Any help on doing this will be appreciated
        • 1. Re: Opening File
          puregas Community Member
          When you refer to a file, do you mean and PDF, Doc files etc?

          If so are they linked to a DB?
          • 2. Re: Opening File
            AidanGuy Community Member
            The files are an assortment of pdf's, docs, xls etc.
            The grid is populated from a SQL database containing the names of the documents but the files are not linked to the database.
            I have it working with one file type by hard coding the extension but need to get it to work with multiple file extensions
            • 3. Re: Opening File
              Chuck1411 Community Member
              Can't you put the file extension in the DB as another column? Then when you do the initial query of the files, send the extension column as well. You don't have to display the extensions in the grid, but the grid will hold the information none the less for each file. So when you click the file, merely append the extension on for it.

              IE something like

              In the grid's onChange() event handler:

              filename = MyGrid.selectedItem.FileName + "." + MyGrid.selectedItem.Extension;

              The syntax might vary depending on scripting language you are using in your particular code.