close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

No way to set which file is downloaded from a recordset?

Thread began 3/16/2012 3:35 pm by Brad Lawryk | Last modified 3/23/2012 2:10 pm by Jason Byrnes | 901 views | 7 replies |

Brad Lawryk

No way to set which file is downloaded from a recordset?

I have a list of documents but it always downloads the very first document. There is no way to set which document it should download?

And it always increments the dl counter for the first record.

Sign in to reply to this post

Jason ByrnesWebAssist

if you are going to use a recordset to tell which file to download, you need to create a way to filter the recordset.

what i normally do is to have a recordset that is used to populate the page. create a form with a submit button and a hidden element, set the hidden element initial value to use the ID column from the recordset. then add a repeat region around the form so that a separate form is created for each record.

you then need to create a lookup recordset that is set to filter the ID column on the hidden form element value

in the download behavior, use the lookup recordset instead of the one that populates the page.

Sign in to reply to this post

Brad Lawryk

"you then need to create a lookup recordset that is set to filter the ID column on the hidden form element value"

Can you do that without creating another page?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, you can create the lookup recordset on the same page.

Sign in to reply to this post

f.coffrant312462

same problem

It seems that I have the same problem, I tried to apply the method described, but nothing helps. The transmitted file has the same name as my page, not the file itself. I put the code attached files used. Thank you for your help.

Attached Files
exemple.txt
Sign in to reply to this post

Jason ByrnesWebAssist

in the form, the hidden element is named "hiddenField";

php:
<input name="hiddenField" type="hidden" id="hiddenField" value="<?php echo $row_rs_fichier['IDfichier']; ?>" />




in the recordset, you have set the filter to use the IDfichier column and a form element named "IDfichier", which does not exist.

you will need to change the name of the form element:

php:
<input name="IDfichier" type="hidden" id="IDfichier" value="<?php echo $row_rs_fichier['IDfichier']; ?>" />




in the Download behavior, you have set the File name to use the IDfichier column from the recordset Is that column the ID column or the file name column?

Sign in to reply to this post

f.coffrant312462

It's now working

Thank's for your help, the problem came in the form and the hidden field.

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

Sign in to reply to this post

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...