473,320 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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/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!
Jul 22 '05 #1
2 5013
> 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é
Jul 22 '05 #2


"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
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: spradl | last post by:
Hi, I am trying to create a dynamic CSV file via FileSystemObject.CreateTextFile. I have no problem creating the CSV file normally but I would like to insert comments and VBScript into the...
8
by: jessie | last post by:
This my code for practice: <html> <body> <% Response.Write("6 ") dim fs,fname set fs=CreateObject("Scripting.FileSystemObject") set fname=fs.CreateTextFile("f:\test.txt")...
2
by: MeAndI | last post by:
I've some problems with "Scripting.FileSystemObject" object If I try to create a new text file with the function myfile.CreateTextFile I have two differents result: If I execute the script...
2
by: Fedroz | last post by:
Hi! Here is my problem: I'm trying a simple script copied by MSDN for read a text file and put the content on output web page! I use the following code: Const ForReading = 1, ForWriting = 2,...
2
by: Stavros | last post by:
Hi all when I execute the following VB6 code in Windows 2000 and as an Administrator, everything is working fine. Project->References->"Microsoft Scripting Runtime" and scrrun.dll is located...
1
by: jpdesaiin | last post by:
I have writtent eh following code to read text from a file. And for whatever reason I am not able to read the text. Can anybody please let me know where is the defect. var ForReading = 1,...
1
by: hugobotha | last post by:
Hi All, I have a problem when saving a text file as a html file in unicode and then google index the Unicode bom as well as I can not open these files. I have a asp page that takes another asp...
7
ADezii
by: ADezii | last post by:
The next series of Tips will involve the Microsoft Scripting Runtime Library (Scrrun.dll). This Library is, in my humble opinion, one of the most useful and practical Libraries ever created. With the...
0
ADezii
by: ADezii | last post by:
This is the last in a series of Tips involving the Microsoft Scripting Runtime Library and deals with creating, opening, writing to, reading from, and closing Text Files via this Library. At this...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.