close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Problems with a download center

Thread began 3/06/2013 10:32 am by Rune Brynestad | Last modified 8/05/2013 6:30 pm by Rune Brynestad | 1345 views | 39 replies

Jason ByrnesWebAssist

ok, the strategy for this will be a little diferant then the download center tutorial, and it will require that you are familiar with the concept of nested recordsets.

the basic outline of how to accomlish this is:
1) you need a table that contains the names of the files to download:

downloads
downloadID - Primary Key
downloadFileName - the name of the file to download

2) you will need a table to record the downloads by the user:
userdownloads
userdownloadID - Prioary Key
userdownloadUserID - releates to the users.UserID column
userdownloadsDownloadID - relates to the downloads.downloadID


3) on the download page, create a recordset to query the downloads table and return the files that are available for download.

add a form with a submit button, a hidden element that is bound to the downloadFileName column, another hidden element that is bound to the downloadID column

add a repeat region around the form so that the form repeats for each available file name.

4) heres where the nested recordset comes into play. Inside the repeat region, you need a recordset to query the userdownloads table. filter the userdownloadUserID column using the session for the logged in user, and filter the userdownloadsDownloadID column on the downloadID column from the main recordset.

for more details on the nested recordset concept see the following tutorial:
http://www.webassist.com/tutorials/Display-nested-recordsets

use a Show region behavior around the download form so that it only shows if the nested recordset is empty.

5) Add the download file behavior, for the file name, use the downloadFileName hidden element

6) add a insert record server behavior to record the file download.

it will insert to the userdownloads table. for the userdownloadUserID column use the User ID session variable. for the userdownloadsDownloadID column use the downloadID form element.



the concept behind this is to record each time a download happens, storing the ID for the downloaded file and the ID for the user.

this information is used to determine whether the download form for that file should show or not based on the user that is logged in.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...