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!
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!