5 Replies Latest reply on Dec 29, 2008 6:39 AM by Newsgroup_User

    Downloading a file

    JumpCat4 Level 1
      I have a site that I developed using Dreamweaver CS4 and PHP and now MySQL. On one page I list several MP3 files which I allow users to download and listen to online (all legal MP3 files). Since the list of files is getting quite long, I decided to set up the list of MP3 files using a MySQL database. I have a recordset for the page and I have the information displayed dynamically using a table with a repeat region with dynamic text in each column. That is, there is a column for 'date', 'author', and 'title' Everything works so far, except for one thing. I would like the user to be able to click on the title, which is shown in my dynamically generated table, and be able to download that specific MP3. In my current setup that works fine, but it is not a dynamic table, just a static page and the user can left click to listen online and right click to "save as" and then download the MP3. Can this be done on a dynmically generated table? If so, what steps do I need to take?
        • 1. Re: Downloading a file
          Level 7
          You would just need to have the name of each MP3 file in the recordset, and
          build the link to it within the repeat region.

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "JumpCat4" <webforumsuser@macromedia.com> wrote in message
          news:gj8rse$c6o$1@forums.macromedia.com...
          >I have a site that I developed using Dreamweaver CS4 and PHP and now MySQL.
          >On
          > one page I list several MP3 files which I allow users to download and
          > listen to
          > online (all legal MP3 files). Since the list of files is getting quite
          > long, I
          > decided to set up the list of MP3 files using a MySQL database. I have a
          > recordset for the page and I have the information displayed dynamically
          > using a
          > table with a repeat region with dynamic text in each column. That is,
          > there is
          > a column for 'date', 'author', and 'title' Everything works so far,
          > except for
          > one thing. I would like the user to be able to click on the title, which
          > is
          > shown in my dynamically generated table, and be able to download that
          > specific
          > MP3. In my current setup that works fine, but it is not a dynamic table,
          > just
          > a static page and the user can left click to listen online and right click
          > to
          > "save as" and then download the MP3. Can this be done on a dynmically
          > generated table? If so, what steps do I need to take?
          >
          >

          • 2. Re: Downloading a file
            JumpCat4 Level 1
            Here is how I build the page:
            1)Put a table with 2 rows & 3 columns
            2)On the first row are the column titles - date, title,

            file name.
            3)Create a recordset with all columns selected and no

            filter and no sort.
            4)Go to the Bindings panel
            5)Insert date (from rs in bindings) into cell below

            "date"
            6)Repeat for title and file name.
            7)Make a repeat region
            8)In the cell below "file name", highlight the dynamic

            text.
            9)In Prop Inspector, go to "link"
            10)Click on Folder icon
            11)Navigate to where files are stored.
            12)Click on one of the files.
            13)Click on "parameters"
            14)Click on "name" and insert "file_id" (my key column)
            15)Tab twice to "value"
            16)Click on lightning bolt
            17)Select "file name" under my recordset.
            18)Click OK until all open menus are closed.
            19)upload file and test.

            What part of the process should I change? Step 12 seems wrong, but I am not sure how else to do it. Would I need a second page? That is, the user sees the dynamically generated list. He then selects one file and that sends him to the second page which is a download page which only shows the one file he has chosen.
            • 3. Re: Downloading a file
              Level 7
              > What part of the process should I change?

              9)In Prop Inspector, go to "link"
              10)Click on Folder icon
              10b)Click on Data Sources radio button
              18)Click OK until all open menus are closed.
              19)upload file and test.
              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              ==================


              "JumpCat4" <webforumsuser@macromedia.com> wrote in message
              news:gj95j2$o6p$1@forums.macromedia.com...
              > Here is how I build the page:
              > 1)Put a table with 2 rows & 3 columns
              > 2)On the first row are the column titles - date, title,
              >
              > file name.
              > 3)Create a recordset with all columns selected and no
              >
              > filter and no sort.
              > 4)Go to the Bindings panel
              > 5)Insert date (from rs in bindings) into cell below
              >
              > "date"
              > 6)Repeat for title and file name.
              > 7)Make a repeat region
              > 8)In the cell below "file name", highlight the dynamic
              >
              > text.
              > 9)In Prop Inspector, go to "link"
              > 10)Click on Folder icon
              > 11)Navigate to where files are stored.
              > 12)Click on one of the files.
              > 13)Click on "parameters"
              > 14)Click on "name" and insert "file_id" (my key column)
              > 15)Tab twice to "value"
              > 16)Click on lightning bolt
              > 17)Select "file name" under my recordset.
              > 18)Click OK until all open menus are closed.
              > 19)upload file and test.
              >
              > What part of the process should I change? Step 12 seems wrong, but I am
              > not
              > sure how else to do it. Would I need a second page? That is, the user
              > sees
              > the dynamically generated list. He then selects one file and that sends
              > him to
              > the second page which is a download page which only shows the one file he
              > has
              > chosen.
              >

              • 4. Re: Downloading a file
                JumpCat4 Level 1
                9)In Prop Inspector, go to "link"
                10)Click on Folder icon
                10b)Click on Data Sources radio button
                10c)Click on "file_name" under recordset
                10d)Insert subdirectory location of files in front of dynamic data
                for ex - root/wavs/MP3/<?php echo ......etc
                18)Click OK until all open menus are closed.
                19)upload file and test.

                Works like a charm. Many thanks. I actually had to do it like the above
                example, but it works now.
                Thanks again.

                • 5. Re: Downloading a file
                  Level 7
                  That's the ticket. Good luck!

                  --
                  Murray --- ICQ 71997575
                  Adobe Community Expert
                  (If you *MUST* email me, don't LAUGH when you do so!)
                  ==================
                  http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                  http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                  ==================


                  "JumpCat4" <webforumsuser@macromedia.com> wrote in message
                  news:gjancs$quo$1@forums.macromedia.com...
                  > 9)In Prop Inspector, go to "link"
                  > 10)Click on Folder icon
                  > 10b)Click on Data Sources radio button
                  > 10c)Click on "file_name" under recordset
                  > 10d)Insert subdirectory location of files in front of dynamic data
                  > for ex - root/wavs/MP3/<?php echo ......etc
                  > 18)Click OK until all open menus are closed.
                  > 19)upload file and test.
                  >
                  > Works like a charm. Many thanks. I actually had to do it like the above
                  > example, but it works now.
                  > Thanks again.
                  >
                  >
                  >