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.createOb ject("Scripting .FileSystemObje ct")
SavePath = Server.MapPath( FilePath)
Set SaveFile = objFSO.CreateTe xtFile(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.BinaryR ead(Request.Tot alBytes)
'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(b iData,nIndex,1) ))
Next
To the following:
rawLength = Request.TotalBy tes
Dim biData, chrData
chrData = Array()
Redim chrData(rawLeng th)
biData = Request.BinaryR ead(rawLength)
For nIndex = 1 to rawLength
chrData(nIndex) = Chr(AscB(MidB(b iData,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! 2 5036
> IIS goes out to lunch when it gets to the CreateTextFile statement in the lines: objFSO = server.createOb ject("Scripting .FileSystemObje ct") SavePath = Server.MapPath( FilePath) Set SaveFile = objFSO.CreateTe xtFile(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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 coding.
Normally, the file would look something like this:
Set filesys = CreateObject("Scripting.FileSystemObject")
Set filetxt = filesys.CreateTextFile("c:\somefile.txt", True)
filetxt.WriteLine "This is the first CSV value," &_
|
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")
fname.WriteLine("Hello World!")
|
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 client-side there are no problems, but if I execute
the script server-side the process stops when I call this function (I think
that the process is in loop because I must close iexplore to stop the
application).
Any thoughts?
|
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, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
|
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 in C:\WINNT\System32
Sub Main()
Dim fs As FileSystemObject
| |
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, ForWriting = 2, ForAppending = 8;
var fso = new ActiveXObject('Scripting.FileSystemObject');
fso.CreateTextFile( "test1.txt" );
var f = fso.GetFile("test1.txt");
var ts =...
|
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 template page and suck some data out of a database, I then create a text file, put this information in there and then save it as a text file except that I change the extenstion to htm.
Basically I create a html file using asp and then save it.
...
|
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 Scripting Runtime Library, you can retrieve information related to Drives, Folders, Files, and Text Files and set/retrieve certain Attributes of Drives, Folders, Files, and Text Files. Through Methods exposed by this Library, you can also manipulate...
|
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 time, the Scripting Library cannot deal with the opening and manipulation of Files in Binary Mode, so we will only demonstrate this functionality as it relates to Text Files. The code is fairly straightforward and sparsely commented, so I will not bore...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |