Solved

I switched to a new server and now my .asp page won't work!

Posted on 2004-09-13
9
281 Views
Last Modified: 2010-04-19
I thought I was careful when I switched my info and files over... but my .asp file doesn't work on the new server.  It still works fine on the old server!  On the new one when I upload a file and run it I get:

Page cannot be displayed

HTTP 500 - Internal server error
Internet Explorer

Does anyone have any ideas?  Thanks in advance-

A few more details:  We send/upload a file with our request from Access when we call the asp file.  

Also, i just installed windows script 5.6, as per the warnings in the .asp file below.

Here is the .asp file:

<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%

'NOTE - YOU MUST HAVE VBSCRIPT v5.0 INSTALLED ON YOUR WEB SERVER
'         FOR THIS LIBRARY TO FUNCTION CORRECTLY. YOU CAN OBTAIN IT
'         FREE FROM MICROSOFT WHEN YOU INSTALL INTERNET EXPLORER 5.0
'         OR LATER.

'Kay for getting info to insert into the database
Dim strCompany, strProperty, strConsultant
Dim strVisitdate, strCalldate, strFilename, strReport
strCompany = Request.QueryString("company")
strProperty = Request.QueryString("property")
strConsultant = Request.QueryString("consultant")
strVisitdate = Request.QueryString("visitdate")
strCalldate = Request.QueryString("calldate")
strFilename = Request.QueryString("filename")
strReport = Request.QueryString("report")

' Create the FileUploader
Dim Uploader, File
Set Uploader = New FileUploader

' This starts the upload process
Uploader.Upload()

'******************************************
' Use [FileUploader object].Form to access
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************
'Response.Write "<b>Thank you for your upload " & Uploader.Form("fullname") & "</b><br>"

' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
      Response.Write "File(s) not uploaded."
Else
      'Kay for insert info into the database
      Dim OBJdbConnection
      set OBJdbConnection=Server.CreateObject("ADODB.Connection")
      OBJdbConnection.Open "DSN=Advisory;"
    Dim strSQL, strFields, strValues
    If (strCompany <> "") and (strFilename <> "") _
    and (strReport <> "") Then
            strFields = "Company, FileName, ReportName"
            strValues = "'" & strCompany & "', '" & _
            strFilename & "', '" & strReport & "'"
            
            If strProperty <> "" Then
                  strFields = strFields & ", Property"
                  strValues = strValues & ", '" & _
                  strProperty & "'"
            End If
            If strConsultant <> "" Then
                  strFields = strFields & ", Consultant"
                  strValues = strValues & ", '" & _
                  strConsultant & "'"
            End If
            If strVisitdate <> "" Then
                  strFields = strFields & ", Visitdate"
                  strValues = strValues & ", '" & _
                  strVisitdate & "'"
            End If
            If strCalldate <> "" Then
                  strFields = strFields & ", Calldate"
                  strValues = strValues & ", '" & _
                  strCalldate & "'"
            End If
            strSQL = "Insert Into Reports (" & strFields & _
            ") Values (" & strValues & ")"
            OBJdbConnection.Execute(strSQL)
            'Response.Write strSQL
      Else
            Response.Write "We didn't receive the information on Company, File Name, or Report. Please verify and try again."
      End If
      
      ' Loop through the uploaded files
      For Each File In Uploader.Files.Items
            ' Save the file
            File.SaveToDisk "C:\Inetpub\wwwroot\advisory\Reports\"
            
            ' Output the file details to the browser
            Response.Write "File Uploaded: " & File.FileName & "<br>"
            Response.Write "Success!"
            'Response.Write "Size: " & File.FileSize & " bytes<br>"
            'Response.Write "Type: " & File.ContentType & "<br><br>"
      Next
End If

%>
0
Comment
Question by:wilbur88
  • 4
  • 4
9 Comments
 
LVL 10

Expert Comment

by:jhautani
Comment Utility
Have you installed or manually registered with regsvr32 the Uploader object?
0
 
LVL 1

Expert Comment

by:ChrisWillis
Comment Utility
make sure you have installed asp page support from the windows componet add in, asp is not loaded by default.

Also check your web service extensions user the IIS mmc console, make sure asp is allowed.
0
 

Author Comment

by:wilbur88
Comment Utility
ChrisWallis:
  ASP is allowed in the windows component section.
  It is also allowed under the IIS mmc console.

jhautani:
  How do I install or manually register with regsvr32 the uploader object?  Maybe this is what the previous programmer did...
0
 
LVL 10

Expert Comment

by:jhautani
Comment Utility
I found details about the upload component you are using in http://www.asp101.com/articles/jacob/scriptupload.asp (well, at least I think this is the one) and found out that you do not need to register any dll's or such; the code is using only an included ASP file.

So, here are a couple points to verify based on the code in your script:

> <!-- #include file="upload.asp" -->
-do you have the upload.asp in the same directory as your code
> File.SaveToDisk "C:\Inetpub\wwwroot\advisory\Reports\"
-is the path same in your new server
-does it have write access both in IIS MAnager and in NTFS permissions

hope this helps
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:wilbur88
Comment Utility
jhautani:
1) yes, i have the upload.asp in the same directory as the code

2) yes, the path is the same as on the new server

3) internet guest account:  on the old server it had full control over the /reports directory.  i added rights to this account to also give full control on the new server for this directory, but it didn't  help.
iis_wpg: same rights on both old and new servers.  (read and ex, list folder cont., and read)
ows_(a bunch of numbers): all but full control is given on both the old and new servers.  

any other ideas?

I guess you saw the dire warning in the link you sent me about having to install vbscript ver 5.0 on the server.  Do you think i satisfied this requirement by installing windows scripting ver 5.6?

Thanks again for your efforts-
0
 
LVL 10

Expert Comment

by:jhautani
Comment Utility
Does the /reports virtual directory have write access in IIS Manager (meaning that IIS itself allows writing to a directory)?

About Scripting host version: I am pretty sure that 5.6 satisfies the requirements as thus far far MS has paid good attention to new versions being backward compatible.
0
 

Author Comment

by:wilbur88
Comment Utility
No, it didn't.  However: The old server didn't have write access in iis manager either.  I just turned write access on and tried it and it still didn't work.  I am leaving write access checked b/c it seems a little weird to me that the old server didn't have it checked and it still worked...

How about this:  I stripped down the upload.asp file to the followin.  Basically i just want to allow the file to accept the parameters Access throws at it when calling it.  But even this simplistic version of the file doesn't work!!!  It gives me the same error.  What do you think?

<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<%

'NOTE - YOU MUST HAVE VBSCRIPT v5.0 INSTALLED ON YOUR WEB SERVER
'         FOR THIS LIBRARY TO FUNCTION CORRECTLY. YOU CAN OBTAIN IT
'         FREE FROM MICROSOFT WHEN YOU INSTALL INTERNET EXPLORER 5.0
'         OR LATER.

'Kay for getting info to insert into the database
Dim strCompany, strProperty, strConsultant
Dim strVisitdate, strCalldate, strFilename, strReport
strCompany = Request.QueryString("company")
strProperty = Request.QueryString("property")
strConsultant = Request.QueryString("consultant")
strVisitdate = Request.QueryString("visitdate")
strCalldate = Request.QueryString("calldate")
strFilename = Request.QueryString("filename")
strReport = Request.QueryString("report")

' Create the FileUploader
Dim Uploader, File
0
 
LVL 10

Accepted Solution

by:
jhautani earned 500 total points
Comment Utility
I tested upload.asp to see whether it has problems in 2003, but it works nicely. I think your problem relates to parameters you are passing to your .asp.
Check the IIS error log to see if it can provide more details about the error. IIS 6 error log is in system32\logfiles\httperr
0
 

Author Comment

by:wilbur88
Comment Utility
thanks for your help over the days.  

It turned out that the problem was the access database that the asp was writing to-  i had to set it's permissions to allow the internet user to write to it.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now