问题描述
我在安装一个非常旧的 web 应用程序时遇到了一个大问题。该应用程序是在 ASP(不是 ASP.Net)中开发的,在新服务器(带有 IIS 10 的 Windows Server 2019)中,它给了我 404.17 错误。
我已经安装了 IIS 的所有附加组件。
我已经正确创建了映射处理程序(也尝试通过 IIS 添加):
def upload_file(request) -> render:
template = 'my-app/upload.html'
if request.method == 'POST' and request.FILES['csvfile']:
csv_file = request.FILES['csvfile']
decoded_file = csv_file.read().decode('utf-8').splitlines()
csv_reader = DictReader(decoded_file,fieldnames=['col1','creation_data','last_login_date','col2'])
for user in csv_reader:
# Create an instance of an User model
new_user = User()
# Todo - the fields of dates has to be parsed to datetime!
new_user.__dict__.update(user)
# Store this user in the database
new_user.save()
return render(request,template)
appPool 是 32 位的,经典的 Managed Pipeline...
在 ISAPI 和 CGI 限制中,允许使用 Active Server Pages。
但是任何应用程序都想在经典的 asp 中工作......(我尝试在 asp 中使用一个简单的页面,它给我的系统一个小时但也失败了,因此我排除了应用程序失败并确保这是一个问题IIS配置)
有没有人有任何可以指导我的想法?
解决方法
你可以试试这个方法来解决问题:
-
转到 IIS > 站点 > example.com > 处理程序映射 > 添加脚本映射。
-
输入以下信息:
请求路径:*.asp
可执行文件:%windir%\System32\inetsrv\asp.dll
名称:ASPClassic
请求限制:文件
动词:GET、HEAD、POST
访问:脚本