Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Open Files from Button

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-08-03 : 07:19:52
I know that you can open a file into your browser using something like file://MyServer/MyFolder/Myfile.doc but if I try the following code

        Dim loc As String
loc = "file://MyServer/MyFolder/Myfile.doc"
loc = loc.Replace(" ", "%20")
Response.redirect(loc)


and click the button that calls this. Nothing happens. Anyone got any clues? I bet it's something dead simple, I just don't know what.

Many thanks in advance

steve


Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.

MichaelP
Jedi Yak

2489 Posts

Posted - 2005-08-03 : 17:35:01
I bet it's a security thing. I don't think your website can redirect a user to a local file. IE, let's redirect a user to myvirus.exe so that it automatically executes and 0wnr0z their box.

Michael

<Yoda>Use the Search page you must. Find the answer you will. Cursors, path to the Dark Side they are. Avoid them, you must. Use Order By NewID() to get a random record you will.</Yoda>
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2005-08-04 : 03:47:48
That's the sort of thinking that I had then I put it into a hyperlink instead of a button and it works. Which I think proves you're right

thanks

steve

Alright Brain, you don't like me, and I don't like you. But lets just do this, and I can get back to killing you with beer.
Go to Top of Page
   

- Advertisement -