Samm1502
asked on
Problem creating file with FileSysteObject
Hi there
I am trying to creat a file using the FileSystemObject from my ASP page.
I can create the object itself without a problem like this
Set objFileSys = Server.CreateObject("Scrip ting.FileS ystemObjec t")
but but when I call the CreateTextFile method as follows:
strPath = "C:\ myTemp\DJ0000001P.html"
Set objFile = objFileSys.CreateTextFile( strPath, True)
The application just hangs and does nothing. Does anyone know why this is. The directory definitely already exists
I can only assume this is some kind of permissions problem.
Does anyone know how I can reolve it?
Many thanks
Sam
I am trying to creat a file using the FileSystemObject from my ASP page.
I can create the object itself without a problem like this
Set objFileSys = Server.CreateObject("Scrip
but but when I call the CreateTextFile method as follows:
strPath = "C:\ myTemp\DJ0000001P.html"
Set objFile = objFileSys.CreateTextFile(
The application just hangs and does nothing. Does anyone know why this is. The directory definitely already exists
I can only assume this is some kind of permissions problem.
Does anyone know how I can reolve it?
Many thanks
Sam
ASKER
Oh its just a typo sorry!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(Wild guess) You may not be able to use .CreateTextFile to create an .html file, so you might have to create this as an .txt, then rename it with an .html extension.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsmthcreatetextfile.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsmthcreatetextfile.asp
did you check permissions on the directory where you are trying to create a file..? IUSR_<machinename>
grant FULL CONTROL to IUSR_<machine name> user. You will be able to create file.
N
N
don't grant full, grant "read & write", "read" and "write"
ASKER
Thanks for all your input, I tried each possible resolution in turn and it was my anti-virus script blocker that was the cause of the problem.
The problem I now face is that the company running the application will most certainly require anti-vrus software of this kind running on the IIS machine so how do I get around this as turning the blocker off will be insecure?
The link given above didn't display but will try and do a serach for it.
Many thanks all
Sam
The problem I now face is that the company running the application will most certainly require anti-vrus software of this kind running on the IIS machine so how do I get around this as turning the blocker off will be insecure?
The link given above didn't display but will try and do a serach for it.
Many thanks all
Sam
^
Is there a space there, or is that a typo?