VBScript error

Discussion in 'ASP .Net' started by RJT, Jan 19, 2005.

  1. RJT

    RJT Guest

    I'm trying to call the following page (VBScript) but I get an Internal
    Server Error 500 in the browser when I try to run this page (it's linked to
    from another page with a submit button). Can anybody tell me what I'm doing
    wrong?

    <%option explicit%>

    <%Response.Buffer = True%>

    <%

    ' Declare objects and variables.

    Dim strPath, strContent, strUserName, publickey, privatekey

    Dim objDownloadMgr, objHeader, strHeader

    ' Retrieve end user and file information from the form.

    strPath = "Download"

    strContent = "PckgNew2-r000292.wmv")

    strUserName= "1234356"

    ' Set the packaging server's private key.

    privatekey = "Put server's private key here"

    ' Create a download manager object.

    Set objDownloadMgr = Server.CreateObject("wmrmobjs.reheader")

    ' Create a header object.

    Set objHeader = Server.CreateObject("Wmrmobjs.WMRMHeader")

    ' Place header information into the header object.


    strHeader = objDownloadMgr.GetDRMHeader(strPath+"\"+strContent)

    objHeader.Header = strHeader

    objHeader.Attribute("UserName") = strUserName

    objHeader.Sign(privatekey)

    strHeader = objHeader.Header

    ' Add the header to the Response object.

    Response.AddHeader "Content-Disposition", _

    "attachment;filename="+strContent

    ' Force the end user to download the packaged file.

    objDownloadMgr.ForceCompleteDownload = True

    ' Download the file.

    call objDownloadMgr.DownLoad(strPath+"\"+strContent, strHeader)

    Set objHeader = nothing

    Set objDownloadMgr = nothing

    %>
    RJT, Jan 19, 2005
    #1
    1. Advertising

  2. > Can anybody tell me what I'm doing
    > wrong?


    Well, to start with, you're posting this to the wrong newsgroup. Try the
    microsoft.public.inetserver.asp.general newsgroup. This is a newsgroup for
    ASP.Net.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "RJT" <> wrote in message
    news:...
    > I'm trying to call the following page (VBScript) but I get an Internal
    > Server Error 500 in the browser when I try to run this page (it's linked
    > to
    > from another page with a submit button). Can anybody tell me what I'm
    > doing
    > wrong?
    >
    > <%option explicit%>
    >
    > <%Response.Buffer = True%>
    >
    > <%
    >
    > ' Declare objects and variables.
    >
    > Dim strPath, strContent, strUserName, publickey, privatekey
    >
    > Dim objDownloadMgr, objHeader, strHeader
    >
    > ' Retrieve end user and file information from the form.
    >
    > strPath = "Download"
    >
    > strContent = "PckgNew2-r000292.wmv")
    >
    > strUserName= "1234356"
    >
    > ' Set the packaging server's private key.
    >
    > privatekey = "Put server's private key here"
    >
    > ' Create a download manager object.
    >
    > Set objDownloadMgr = Server.CreateObject("wmrmobjs.reheader")
    >
    > ' Create a header object.
    >
    > Set objHeader = Server.CreateObject("Wmrmobjs.WMRMHeader")
    >
    > ' Place header information into the header object.
    >
    >
    > strHeader = objDownloadMgr.GetDRMHeader(strPath+"\"+strContent)
    >
    > objHeader.Header = strHeader
    >
    > objHeader.Attribute("UserName") = strUserName
    >
    > objHeader.Sign(privatekey)
    >
    > strHeader = objHeader.Header
    >
    > ' Add the header to the Response object.
    >
    > Response.AddHeader "Content-Disposition", _
    >
    > "attachment;filename="+strContent
    >
    > ' Force the end user to download the packaged file.
    >
    > objDownloadMgr.ForceCompleteDownload = True
    >
    > ' Download the file.
    >
    > call objDownloadMgr.DownLoad(strPath+"\"+strContent, strHeader)
    >
    > Set objHeader = nothing
    >
    > Set objDownloadMgr = nothing
    >
    > %>
    >
    >
    >
    >
    Kevin Spencer, Jan 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PaulieS
    Replies:
    1
    Views:
    3,259
    Kevin Spencer
    Nov 28, 2005
  2. Carolyn Speakman
    Replies:
    1
    Views:
    1,040
    Keith M. Corbett
    Jul 30, 2004
  3. Replies:
    0
    Views:
    922
  4. Frank
    Replies:
    2
    Views:
    117
    Curt_C [MVP]
    Aug 21, 2003
  5. Joseph Narissi

    VBScript Error with CDONTS

    Joseph Narissi, Sep 3, 2003, in forum: ASP General
    Replies:
    3
    Views:
    115
    Aaron Bertrand - MVP
    Sep 3, 2003
Loading...

Share This Page