vbscript FileSystemObject works locally but not live
can anyone tell me what's going on with this (what should be) simple peice of VBscript. It is working locally but as soon as I try it online, it kick out an error as below! Everythings saved in the root!
Any ideas appreciated! I'm starting to pull my hair out!
<%
'path = filesys.GetAbsolutePathName("c:/inetpub/wwwroot/website/somefile.txt")
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.OpenTextFile (server.MapPath("/somefile.txt"), 8, True)
filetxt.WriteLine("Last Update: ") & Now
filetxt.Close
%>
开发者_如何转开发
I keep getting the following error...
Microsoft VBScript runtime error '800a0046'
Permission denied
/locations.asp, line 6
Error description is clear. You need write access to the directory which you want. If you're a hosting customer, you should grant write permission to the IUSR account in your control panel. Usually, username similar to IUSR_sitename.com
. So If it all gets too confusing, perhaps you should open a ticket in your provider's helpdesk.
精彩评论