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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide url of downloadable document

Status
Not open for further replies.

TerryDad2

Programmer
Jul 10, 2002
29
US
I have a HyperlinkColumn that I want to completely hide the url from the client in both the browser and the code. I've got to prevent users from randomally trying other urls from the same folder to try to get other documents.

I am picturing that the HyperlinkColumn would instead of going to a url, fire off a server side funciton that gets the file and starts the download without showing the location to the client.

Any other solutions would be entertained as well.
 
One way would be to use a JavaScript function, e.g.,

DataNavigateUrlField = "myfilename"
DataNavigateUrlFormatString="javascript:eek:penfile();"

and then in the javascript:

function openfile() {
'open up url/scr/file here in java
}

...just an idea.

 
Another possibility would be the old ASP trick of creating a download page (or display page) that accepts some form arguments (such as filename) and then opens the file and binary writes it to the output. This way the user only ever sees the page that is actually doing the work and your real file can be located in another directory, such as a directory not in the web folder hierarchy.

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
It sounds like Tarwn's solution is what I am looking for. I'll search the ASP pages to see how to implement it. I've not seen that trick before. Do you have any suggestions of where to see examples of this code?

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top