On the checkout success page you will want to have a query to display all of the files available to download. This would be based on the values in the order details and order tables and will be filtered on the order id that is in the session. You can see what this value is in your store order summary server behavior, it is the session variable listed here for the id.
So an example of this query might look like this:
SELECT * FROM orders
JOIN order_details ON orders.orderID = order_details.orderID
WHERE orders.orderID = <your session var value>
Your session var value should be equal to the session value that is set in the store order summary server behavior.
You can then use the bindings from this recordset in a repeat region to display all of the items the user has purchased. You would then want to make links to your download page from this list of items. This link should include a URL parameter for the item id.
Then on your download page you would have a recordset that is similar but it will also select from the files table based on the item id you have in the URL parameter.
SELECT * FROM orders
JOIN order_details ON orders.orderID = order_details.orderID
JOIN files ON files.itemID = order_details.itemID
WHERE orders.orderID = <your session var value>
AND files.itemID = <your URL parameter for the itemID>
For the download server behavior you would trigger it based on the recordset not being empty. For the file to download you can use the binding from this rs for the filename.
This is just an example of how you will need to have it, you will need to adapt this to your current implementation. I would suggest that you get started on this and if you run into problems let us know and post what you have and what you are getting with it.