Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Drop Down menu to download files - How do I do it?

Status
Not open for further replies.

redwatty

IS-IT--Management
Aug 3, 2001
46
GB
I have been to a number of forums to try to get a basic tutorial on how to get this to work.

I need to know in what form my links need to be in as a field in an Access table. I have tried it has a hyperlink, I have also tried it as a http:// URL. I have tried most ways of entering the file location in the database.

My access table has the fields:

FileID
File_Desc
File_location

I have then created a recordset, placed a form tag on the page inserted a menu list form object and then added a dynamic list/menu. The files that I want to make available for download are located within the same folder as the download.asp page that I want the drop down menu on.

Is there something basic that I am missing here. Can anybody help or point me to a useful tutorial.

Thanks
 
Hi

So your link to the files to be downloaded doesn't work? Odd. It's no way a tutorial as my typing is bad, but this is how I would do it.

In the access table make sure that the path to the file is correct (by all means use either relative links or full links)

Test this! Query the recordset and create a repeat region on some simple text which is a link to the file_location. This will give you a "test" list of all your files as links. Click on the hyperlinks and check to see if they work and prompt the user to download the file. Do not pass go until this works!

Next create your form and insert into it a jump-menu. Add one dummy entry (I normally leave untitled as the entry). DW will now have added all code you need to jump to a url (if this is to one of your files then it will prompt for download).

Then select the jump menu and make it a dynamic list/menu where file_desc is the show value and file_location is the value of the list.

Go into the Code view window and find your menu. The first option entry should say "Untitled" or whatever dummy entry you added. Change this text to say "Choose a file to download" and make sure that the value is set to "#".

This should be it.

Just post again if you have any problems or if I am talking rubbish.

Derren [The only person in the world to like Word]
 
Nope Derren,

That's not rubbish. It's exactly the way that I would have tried to do it!
(would you like to see my working out on paper?)

Post your code, RedWatty if you're in need of any further help. You're in the right place, we're mostly desperate here too!

Have fun!

M
 
Thanks for all your advice guys. I managed to get in working just using a jump menu.

However the course of development never runs smooth. When I publish the page to my internal web server I get the following highly informative and descriptive message.

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

Please try the following:

Open the support home page, and then look for links to the information you want.
Click the Refresh button, or try again later.

Click Search to look for information on the Internet.
You can also see a list of related sites.

HTTP 500 - Internal server error
Internet Explorer


I have checked the permissions of this page and can't see anything that should stop it being viewed. I have another site that is using ASP created in Ultradev that is set up exactly the same, that is working perfectly well. If I remove the form object and the form tag the page works fine.

I have Low Process IIS set in the properties of the site and have tried medium pooled to no avail. The site is also set up for anonymous access.

Dig deep in your knowledge and save me a day of hair tearing and hand wringing.

Thanks

Red
 
500 error is the worst one of all. Can it be any more vague? I think not!

Can you get the page to work on the other server? It can sometimes be just a small error in the code rather than server setup, the error can be quite misleading. Derren
[The only person in the world to like Word]
 
I had this error in my ISP server a while back, have you tried simply resetting IIS and restarting the box?

(Not too clued up on this as they took a week to sort it out and I had no feedback)

M

P.S. If anybody know's the solution, can they tell me if an ASP trappable error is something that I can prevent in my code or is that a server issue too? (hint: it's seems to resolve after 5 minutes, normally just after I've demoing the site to a potential client! DOH!)
 
Right then, this is getting silly. As I realised that there wasn't any actual dynamic data on this page only a jump menu to static files, I changed the pages extension to .htm instead. This worked and allowed the page to be viewed.

As a test I then renamed the page back to .asp and removed a recordset that I had created earlier, as part of my attempts at a dynamice drop down menu. With no recordset specified the page works with a .asp extension. Go figure.

My next minor niggle is that when a user selects an available .doc to download, the file is simply opened up in word rather than offering the opportunity to download and save the file. Can anyone tell me if there is a way I can make sure that the user is given the option to save or open the file.

Oh lord don't fail me now!

Red
 
Yes,

well let me offer a tad bit of useless (sometimes) Info.

If you goto tools/internet options/advance tab on Internet Explorer, uncheck show friendly http error messages.

That will let you see an error that may actually help, although sometimes it'll show the error being the execute line in your page - but the real problem is somewhere else before it will execute. But with luck it'll let you narrow it down some.

On the second end. You can "Force" a download. Here is a link to a script I've used. Took some playing around with but once you get it set - works pretty good.
 
Schase thanks for your bit of useless info, which was actually a good tip.

I have downloaded the script you suggested unfortunatly this would involve a rather long course on hard coding ASP. I don't have the experience to play around with the code to make it work with my files.

Is there a simple way to get this script to work with my pages. Although I have some basic programming knowledge of VB, looking at the code of the pages you suggested filled me with a cold fear and I was forced to retreat to the comfort zone of Ultradev's GUI.

Any further assistance would be greatly appreciated

Red

 
schase,

Nice extension! I have got it working of a sort. Hopefully this will be the last time I need darken your door for a while.

In what context are you using it. I have a downloads page call downloads/default.asp. On this page I have a jump menu to some .doc and .pdf files that I want to make available for clients. The files are stored in the root of the downloads folder i.e inetpub\ This is the same location as my default page for this section and I think that may be where my problem arises.

When I apply the extension to one of my .doc files, and I then choose it from the jump menu, I am prompted to download the default.asp. If I choose to open or download it actually does open the required file. This is going to be very confusing for our clients, as this is supposed to be a support site. I have tried creating an asp page for each downloadable file and this works slightly better execpt it still obviously says it is downloading an asp page and not the chosen .doc or .pdf file.

Is there a way I can get it to say I am downloading the actual file that I chose on the jump menu and not an associated web page?

It's Friday it's 09.57 and the day's already to long.

Red
 
Are you assigning an ID to each downloadable file in your db? If you are then use your jump menu to pass the parameter in the link page, ala;

../downloads/default.asp?DownloadID=(rsName.Fields.Item("DownloadID").Value)

I think that's along the right lines, it should lift the ID of the download file from the database. Just be sure to filter the recordset on the download/default.asp page based on ID (pretty much like a standard detail page)

Hope that's somehow helpful, I have just typed it in without testing it but have a fiddle, go on!

Have fun

M
 
yea,

and if I recall right - then again I very well may not be. But I stored my download in a separate folder and mine are movie files, why? well for posterity sake, cause I can, it's a power trip really.

But actually - I did to keep things organized...... nah lets go for the power trip.


But I never had that happen. Is this on an intranet? or published someplace? it's acting like the link is file:\\c:\blah blah blah


 
Hi schase,

It is currently on an Intranet but if I get it working will be published eventually.

I will attempt to organise them in a seperate folder and see if it makes a difference.

I'll let you know.

It's Friday and there's some brain pickling to be done!

Red
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top