|
Home > Archive > IIS ASP > April 2005 > Scripting.FileSystemObject.CreateTextFile goes out to lunch
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Scripting.FileSystemObject.CreateTextFile goes out to lunch
|
|
|
| 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/d...tml/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!
| |
| André Nobre 2005-04-28, 7:55 am |
| > 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é
| |
|
|
"André Nobre" wrote:
> 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
|
|
|
|
|