Help renaming applescript with asp on download

I work for a university Residence hall computer support and I was given the task of writing a script to get the users computer name and MAC address so we can log it in the database. I wrote the script, and it works just fine, but when asp renames it, it also adds the HTML from the page into the code of the script and it won’t run. I do not do ASP personally, but here is a code sample:

            filepath = "\\servername\ResReg\resregmac.app"
            headerName = "Content-Disposition"
            headerValue = "attachment; filename=""" & "regstartup$" & encryptedUser & "$" & EncodeBase64(regserver) & ".app" & ""
        If Not filepath Is Nothing Then
            If File.Exists(filepath) Then
                Dim filename As String = Path.GetFileName

Another problem I am having is that Safari cuts off the last letter in the extension, this works fine in Firefox.

Any help would be greatly appreciated.

Harter

Model: PowerMac, dual 867MHz
AppleScript: Latest
Browser: Firefox 1.5
Operating System: Mac OS X (10.4)