Please help - error in re-direction

Results 1 to 3 of 3

Thread: Please help - error in re-direction

  1. #1
    Harsha Bhogle Guest

    Default Please help - error in re-direction

    Hi,<BR><BR>I had written code for generating word document in the server. I&#039;ve saved that document in the server itself like this -<BR><BR>strTmpDir = "c:Harsha\"<BR>set objFSO = Server.CreateObject ("Scripting.FileSystemObject")<BR>strFileName = strTmpDir & ObjFSO.GetBaseName(objFSO.GetTempName) & ".doc"<BR><BR>It&#039;s working perfectly alright. But the problem comes when I try to redirect the document to the browser. I wrote -<BR><BR>Response.Redirect strFileName<BR><BR>But it&#039;s throwing back error. My doubt is -<BR><BR>1. What is wrong in my Redirection code <BR>2. Will I be able to provide link for that document in my page, <BR> so users can click and download that document?<BR><BR>Please help.<BR>Harsha Bhogle<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Please help - error in re-direction

    You can&#039;t use Response.Redirect(URL) to create a link to a file. The Redirect method stops processing the current script and attempts to connect the browser to a different URL. You must use something like<BR>Response.Write("&#060;a href = "file://..."&#062;Download&#060;/a&#062;")<BR>Hope I helped you.

  3. #3
    Join Date
    Dec 1969

    Default chuckle...

    This will be a link on the client machine, not the server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts