Asp classic 在不同的ASP服务器上创建对象

Asp classic 在不同的ASP服务器上创建对象,asp-classic,server,Asp Classic,Server,我想在ASP中的其他服务器上创建一个临时文件 这是我的代码: <% dim fs,fo,tfile,tname,mappad set fs=Server.CreateObject("Scripting.FileSystemObject") response.Write("Path is "&Server.MapPath("\tmp")) Set fo=fs.GetFolder(Server.MapPath("\tmp")) tname=fs.GetTempName mappad=

我想在ASP中的其他服务器上创建一个临时文件

这是我的代码:

<%
dim fs,fo,tfile,tname,mappad
set fs=Server.CreateObject("Scripting.FileSystemObject") 
response.Write("Path is "&Server.MapPath("\tmp"))
Set fo=fs.GetFolder(Server.MapPath("\tmp"))
tname=fs.GetTempName
mappad=Server.MapPath("tmp\")
set tfile=fo.CreateTextFile(tname,false)
tfile.WriteLine(Server.MapPath("\tmp")&tname)
tfile.close
 response.Write("file "&tname&" created succesfully")
set tfile=nothing
set fo=nothing
set fs=nothing
%>

问题是我在我的根映射中写入,但我需要在网络上的另一个映射中写入。这是因为IT部门不希望我们的开发者直接在网站上写作。因此,我不想写C://inetpub/wwwroot(这是我的本地测试服务器ofc。),而是想写C://wwdb/images。在生产环境中,它应该从intranet.mydomain.com更改为*\network\appdata\images*


提前谢谢

使用绝对路径而不是server.mappath-eg
Set fo=fs.GetFolder(“C:\wwdb\images”)

请记住授予IUSR帐户写入目标文件夹的权限


(根据影子向导的建议将我的评论作为答案发布)

使用绝对路径而不是server.mappath-eg
Set fo=fs.GetFolder(“C:\wwdb\images”)

请记住授予IUSR帐户写入目标文件夹的权限


(根据影子向导的建议将我的评论作为答案发布)

您可以使用绝对路径而不是server.mappath-eg
Set fo=fs.GetFolder(“C:\wwdb\images”)
。您需要确保您的IUSR帐户对要写入的文件夹具有写入权限。@John最好将此作为答案发布。您可以使用绝对路径而不是server.mappath-eg
Set fo=fs.GetFolder(“C:\wwdb\images”)
。您需要确保您的IUSR帐户对要写入的文件夹具有写入权限。@John最好将此作为答案发布。