I am a new subscriber, and I need to understand why I can't create a
Scripting.FileSystemObject...
I am experiencing the following errors:
Error type:
aspSmartUpload.File (0x80040460)
Unable to save file (Error 1120)
/scripts/aspSmartUpload/Sample1.asp, line 25
Browser:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Script:
POST 20438 bytes to /scripts/aspSmartUpload/Sample1.asp
POST Data:
error '80020009'
Exception.
/iisHelp/common/500-100.asp, line 223
--
Curt
Software_AT_Darkfalz.Com
http://www.Darkfalz.com
---------------------------------------------------------------
** And The Geek Shall Inherit The Earth
---------------------------------------------------------------
"Rafael" <raf...@analogkid.cjb.net> wrote in message
news:eedRBiw5BHA.2312@tkmsftngp05...
here it is:
*************************
savename = "/images/file.txt";
filecontent = "Texto";
var fso = new ActiveXObject ("Scripting.FileSystemObject");
file = fso.CreateTextFile (Server.MapPath(save_name), true); //
overwrite
file.Write(filecontent);
file.Close ();
delete file; // delete object (not disk file);
delete fso;
********************
and the folder 'images' has writing permisssions.
Thanks for trying to help me
Rafael - Brazil
"Curt_C" <Software_AT_Darkfalz.Com> escreveu na mensagem
news:eBLPUpw5BHA.1632@tkmsftngp07...
Just a shot in the dark, but savename = "/images/file.txt"; is not the same
as file = fso.CreateTextFile (Server.MapPath(save_name), true);. savename
is not the same as save_name. Could that be the problem?
Hope this helps,
CEF
"Rafael" <raf...@analogkid.cjb.net> wrote in message
news:#of2zzw5BHA.1996@tkmsftngp05...
>Do you want to say the piece of code?
>
>here it is:
>*************************
> savename = "/images/file.txt";
> filecontent = "Texto";
> var fso = new ActiveXObject ("Scripting.FileSystemObject");
You can't initialize a VBS variable in the declaration. Also, you need
to use "set" to assign an object. And, you need to use
Server.CreateObject:
var fso
set fso = Server.CreateObject("Scripting.FileSystemObject")
And if you're on the client, you probably will be prevented from using
the file system object by security constraints.
--
Tim Slattery
MS MVP(DTS)
Slatt...@bls.gov
I am not using VBScript on the script, I am using JScript, but I don't know
if this syntax below is acceptabel in JScript:
Server.CreateObject("Scripting.FileSystemObject");
My script is running on the same machine of the destination 'file', and it
was working before, but suddenly, I started to get problems...
Thanks,
Rafael
"Tim Slattery" <Slatt...@bls.gov> escreveu na mensagem
news:dj9ubugejvch6mqbs...@4ax.com...
Unfortunately, this is not the problem. I just typed 'save_name' incorrectly
at first occurrence in my post, but the script does not have this bug.
Thanks
Rafael
"Charles E Finkenbiner" <Charl...@Yahoo.Com> escreveu na mensagem
news:#6Jv#7w5BHA.2240@tkmsftngp04...
*************************
<%@LANGUAGE="JAVASCRIPT"%>
<%
save_name = "C:\images\file.txt";
filecontent = "Texto";
It's not here-> var fso = new ActiveXObject
("Scripting.FileSystemObject");
but here -> file = fso.CreateTextFile(save_name, true);
file.Write(filecontent);
file.Close();
delete file;
delete fso;
%>
********************
However, that folder has writing permissions... The mystery continues, to
me...
Rafael
P.S.: The error message that appears: (text in Brazilian Portuguese)
HTTP 500.100 - Servidor interno Erro - erro do ASP
Internet Information Services
----------------------------------------------------------------------------
----
Informações técnicas (para a equipe de suporte)
a.. Tipo de erro:
Erro em tempo de execução do Microsoft JScript (0x800A0046)
Permissão negada
/pcs/upload/write.asp, line 4
b.. Tipo de navegador:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
c.. Página:
GET /pcs/upload/write.asp
d.. Hora:
sexta-feira, 19 de abril de 2002, 11:08:49
e.. Mais informações:
Suporte da Microsoft
I see no 'var' in front of "file = fso.CreateTextFile(save_name, true);".
Have you defined it somewhere else?
Hope this helps,
CEF
"Rafael" <raf...@analogkid.cjb.net> wrote in message
news:evmcw565BHA.2088@tkmsftngp04...
"Tim Slattery" <Slatt...@bls.gov> wrote in message
news:dj9ubugejvch6mqbs...@4ax.com...
"Rafael" <raf...@analogkid.cjb.net> wrote in message
news:evmcw565BHA.2088@tkmsftngp04...
I did it, the folder has these permissions, and I also create an
"application" on IIS to debug it, but the problem persists...
Unfortunately the debug message does not contains additional information
beyond below... (Permission denied, etc.)
I am almost quitting...
Thanks,
Rafael
"Richard Roe" <ro...@nib.co.za> escreveu na mensagem
news:eFRYhsf6BHA.1632@tkmsftngp07...
| Check your virtual directory permissions on IIS. Your require Scripts and
| Executables permission to be set on Execute permissions.
|
|
| "Rafael" <raf...@analogkid.cjb.net> wrote in message
| news:evmcw565BHA.2088@tkmsftngp04...
| > Now I know when the code crashes...
| >
| > *************************
| > <%@LANGUAGE="JAVASCRIPT"%>
| > <%
| > save_name = "C:\images\file.txt";
| > filecontent = "Texto";
| > It's not here-> var fso = new
ActiveXObject("Scripting.FileSystemObject");
In JavaScript, to represent the backslash character is needed to put two
backslashes (i.e.: "\\" outputs "\")...
The single backslash is used to print out special characters. For example:
the linefeed is "\n";
the carriage-return is "\r";
the double-quote is "\"";
So, the wrong code:
********************
<%@LANGUAGE="JAVASCRIPT"%>
<%
It's HERE -> save_name = "C:\images\file.txt";
filecontent = "Texto";
It's not here-> var fso = new ActiveXObject("Scripting.FileSystemObject");
nor here -> file = fso.CreateTextFile(save_name, true);
file.Write(filecontent);
file.Close();
delete file;
delete fso;
%>
*******************
The correct code:
********************
<%@LANGUAGE="JAVASCRIPT"%>
<%
save_name = "C:\\images\\file.txt";
filecontent = "Texto";
var fso = new
ActiveXObject("Scripting.FileSystemObject");
file = fso.CreateTextFile(save_name, true);
file.Write(filecontent);
file.Close();
delete file;
delete fso;
%>
********************
Thanks for all who tried to help me
Rafael, from Brazil
P.S.: Forgive my poor English.
--
Bill James
Microsoft MVP·DTS
Win9x VBScript Utilities » www.billsway.com/vbspage/
Windows Tweaks & Tips » www.billsway.com/notes_public/
"Igor O" <bed...@hotmail.com> wrote in message news:eog48qd6BHA.2140@tkmsftngp03...
> > > savename = "/images/file.txt";
> > > filecontent = "Texto";
> > > var fso = new ActiveXObject ("Scripting.FileSystemObject");
> >
> > You can't initialize a VBS variable in the declaration. Also, you need
> > to use "set" to assign an object. And, you need to use
> > Server.CreateObject:
> >
> > var fso
> > set fso = Server.CreateObject("Scripting.FileSystemObject")
"Bill James" <wgj...@mvps.org> wrote in message
news:uFU2fIh6BHA.2308@tkmsftngp04...