Scripting.FileSystemObject.CreateTextFile goes out to lunch

N

NeilS

I'm developing under IIS V5.1 and testing on an ethernet with IIS hosted on
WinXPPro.

I am trying to implement file-upload using a polished version of the
technique published in
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnasdj01/html/asp0900.asp>

IIS goes out to lunch when it gets to the CreateTextFile statement in the
lines:
objFSO = server.createObject("Scripting.FileSystemObject")
SavePath = Server.MapPath(FilePath)
Set SaveFile = objFSO.CreateTextFile(SavePath, True)
SaveFile.Write(fileData)
SaveFile.Close
- it is (presumably) the CreateTextFile method, because I can comment out
the Write statement and it still hangs.
Stopping and restarting IIS doesn't work, it's reboot time.

I already have a (working) script that exports an Access query to an XML
file in the directory I want to upload the file to, so it's (apparently) not
a permissions issue.

Any ideas of what I'm missing, or a workaround?

Thanks

NeilS

BTW - the mods I did to Steven Disbrow's code were basically to get a factor
of four improvement in processing speed for the file I wanted to upload by
changing:
PostData = ""
Dim biData
biData = Request.BinaryRead(Request.TotalBytes)
'Careful! It's binary! So, let's change it into something a bit more
manageable.
For nIndex = 1 to LenB(biData)
PostData = PostData & Chr(AscB(MidB(biData,nIndex,1)))
Next

To the following:
rawLength = Request.TotalBytes
Dim biData, chrData
chrData = Array()
Redim chrData(rawLength)
biData = Request.BinaryRead(rawLength)
For nIndex = 1 to rawLength
chrData(nIndex) = Chr(AscB(MidB(biData,nIndex,1)))
Next
PostData = Join(chrData,"")

- you can imagine the performance of moving quarter-megabyte strings around
in memory every time you need to concatenate an extra character!
 
A

André Nobre

IIS goes out to lunch when it gets to the CreateTextFile statement in the
lines:
objFSO = server.createObject("Scripting.FileSystemObject")
SavePath = Server.MapPath(FilePath)
Set SaveFile = objFSO.CreateTextFile(SavePath, True)
SaveFile.Write(fileData)
SaveFile.Close
- it is (presumably) the CreateTextFile method, because I can comment out
the Write statement and it still hangs.
Stopping and restarting IIS doesn't work, it's reboot time.

Some Antivirus programs blocks this kind of operation. See the
configuration section to disable Script blocking.

André
 
N

NeilS

André Nobre said:
Some Antivirus programs blocks this kind of operation. See the
configuration section to disable Script blocking.

I remember now, I've been bitten by this one before. Thanks so much.

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top