Unknown code page

chuck clark

Usenet Archive
Joined
Apr 17, 2002
Messages
6
Reaction score
0
Hi,
I understand that for security and other reasons that javascript does not support writing/reading to text files. I am looking for a way that will however. This is what i am trying to do. I want to develop a simple html page that is run locally on a windows 2000 box in IE. The page will have a browse button to select a source folder, either locally or a network computer on same lan. A destination folder, either locally or a network computer on same lan These two paths will be written to a text file. Then the page has two fields, A and B. Both A and B have their own 'Add' Buttons. So I would enter a number into either field A or B and hit add. Then the whole form has a Reset and Submit Button. So once I was done entering all the data into all fields, I would hit submit and create a text file from it. I made this quickly to give an idea http://www.largeprojections.com/js/page1.htm

One thing i would like to do is display all the data I have entered, so once I select the Source folder, it displays on the page. Likewise with the data in Fields A and B once I add it. So the page may look like this http://www.largeprojections.com/js/page2.htm It wouldn't have to look or behave just like this, but just a way for me to see what has been entered.

so then it creates a text file and all the values need to be separated by a comma, so the end result would be data.txt Source, F:\pictures\photos, Destination, \\Chuckwhite\c\My Shared Folder, A, 394859, 493029, 584920, 938934, 843234, 839238, 950535, 3438595, 349450, 239405, 839049, 930499, 039483, B, 304893, 930984, 930945, 948404, 340594, 483920, 849302, 483920, 849472, 138594, 039483, 585048, 9302938, 893849, 9304849, 938403, 823940, 734892, 83749, 847433,

Any help or suggestions on how to do this is appreciated, Chuck
 

Fabian

Usenet Archive
Joined
Mar 1, 2001
Messages
309
Reaction score
0
chuck clark hu kiteb:

Hi,
I understand that for security and other reasons that javascript does not support writing/reading to text files. I am looking for a way that will however.

Eh? I thought you just that you understood it to be impossible.
 

Brian Genisio

Usenet Archive
Joined
Dec 22, 2003
Messages
276
Reaction score
0
chuck clark wrote:

Hi,
I understand that for security and other reasons that javascript does not support writing/reading to text files. I am looking for a way that will however. This is what i am trying to do. I want to develop a simple html page that is run locally on a windows 2000 box in IE. The page will have a browse button to select a source folder, either locally or a network computer on same lan. A destination folder, either locally or a network computer on same lan These two paths will be written to a text file. Then the page has two fields, A and B. Both A and B have their own ...

I know that Hyper Text Applications (HTA) allow you to override a lot of security features... and I _thought_ you could write files with it, but I am not sure. It only works with IE, but it sounds like that with your requirements, this might not be a problem.

I know that MSDN has minimal documentation for the HTA technology. I also know that there are a few other platform-specific technologies that do this type of thing, but I cant think of them off the top of my head.
They end up being extensions.

Brian
 

MikeB

Usenet Archive
Joined
Mar 20, 2000
Messages
264
Reaction score
0
"Brian Genisio" wrote:
chuck clark wrote:

> Hi,
> I understand that for security and other reasons that javascript does
> not support writing/reading
> to text files. I am looking for a way that will however.
> This is what i am trying to do. I want to develop a simple html page
> that is run locally on a windows
> 2000 box in IE. The page will have a browse button to select a source
> folder, either locally or a network
> computer on same lan. A destination folder, either locally or a network
> computer on same lan
...

HTA DOES allow read/write to the local file system....

http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

requirements, this might not be a problem.

I know that MSDN has minimal documentation for the HTA technology. I also know that there are a few other platform-specific technologies that do this type of thing, but I cant think of them off the top of my head.
They end up being extensions.

Brian
 

Laurent Bugnion GalaSoft

Usenet Archive
Joined
Aug 23, 2002
Messages
608
Reaction score
0
Hi,

Fabian wrote:

chuck clark hu kiteb:

>Hi,
> I understand that for security and other reasons that javascript
>does not support writing/reading
>to text files. I am looking for a way that will however.

Eh? I thought you just that you understood it to be impossible.

He never said it was impossible. He said that JavaScript does not support it, which is correct (at least client-side JavaScript). However, there are possibilities, using Java classes or ActiveX technology (which is not JavaScript, but which can be scripted).

However, the security model of browsers often blocks this, at least in normal security conditions.

Hereunder an example that I use with local HTML files or HTA applications.

Laurent

CExplorer.ALERT001 = "This method works only in Netscape 4.* " + "and Internet Explorer"; CExplorer.ALERT002 = "The file already exists, overwrite?"; CExplorer.ALERT003 = "This method works only on Windows platforms.";

CExplorer.saveTextFile = function( strFullPath, strContent, bOverwrite ) { if ( ( navigator.appName != "Netscape" ) && ( navigator.appName != "Microsoft Internet Explorer" ) ) { alert( CExplorer.ALERT001 ); return; }

if ( ( navigator.appName == "Netscape" )
&& ( parseFloat( navigator.appVersion ) >= 5 ) )
{
alert( CExplorer.ALERT001 );
return;
}

if ( navigator.platform.indexOf( "Win" ) == -1 )
{
alert( CExplorer.ALERT003 );
return;
}

if ( navigator.appName.indexOf( "Netscape" ) == -1 ) { var fso = new ActiveXObject( "Scripting.FileSystemObject" );

if ( bOverwrite
|| !fso.FileExists( strFullPath )
|| confirm( CExplorer.ALERT002 ) )
{
var flOutput = fso.CreateTextFile( strFullPath, true ); flOutput.Write( strContent ); flOutput.Close; return true; } else { return false; } } else { netscape.security.PrivilegeManager.enablePrivilege( "UniversalFileRead" );

var flCheck = new java.io.File( strFullPath );

if ( bOverwrite
|| !flCheck.exists
|| confirm( CExplorer.ALERT002 ) )
{
netscape.security.PrivilegeManager.enablePrivilege( "UniversalFileWrite" ); var fsOutput = new java.io.FileOutputStream( strFullPath ); var flOutput = new java.io.DataOutputStream( fsOutput );

flOutput.writeBytes( strContent );

flOutput.flush;
fsOutput.close;
return true;
}
else
{
return false;
}
}
}
 

Bob Hairgrove

Usenet Archive
Joined
Jun 26, 2003
Messages
620
Reaction score
0
Hello,

Does anyone know offhand which single-byte code page maps the German Umlaut character "ä" to hexadecimal 8A?

Or does anyone have a URL handy to look up such things?

Thanks.
 

Mark Szlazak

Usenet Archive
Joined
May 21, 2001
Messages
109
Reaction score
0
"Laurent Bugnion, GalaSoft" wrote:
Hi,

Fabian wrote:

> chuck clark hu kiteb:
>
>
>>Hi,
>> I understand that for security and other reasons that javascript
>>does not support writing/reading
>>to text files. I am looking for a way that will however.
>
...

You could add more branches and then use JavaScript via XPCOM to read or write to local files in Mozilla and Netscape 7. Check out the following link for details:

http://www.faqts.com/knowledge_base/view.phtml/aid/23360/fid/53
 

Bob Hairgrove

Usenet Archive
Joined
Jun 26, 2003
Messages
620
Reaction score
0
When writing on such a subject, you should really use a newsreader that is capable to declare the encoding ("charset") in messages.
Get version 1.93!

The problem is irrelevant to my newsreader. We are encountering these problems at work where we are decompressing binary data stored in 2D barcodes and storing the result in XML files. Within the data itself, there is no indication of the code page, and we get the data from a variety of systems, from a scan workflow, the internet, etc. It's pretty wild.
 

Alan J. Flavell

Usenet Archive
Joined
Jan 13, 2000
Messages
1,630
Reaction score
0
When writing on such a subject, you should really use a newsreader that is capable to declare the encoding ("charset") in messages.
[..]
The problem is irrelevant to my newsreader.

If you're going to post to usenet, then I'd say Andreas offered good advice about doing it. And particularly if you're posting about character coding problems.

As we see, this shortcoming _was_ relevant to your description of the problem, even if it wasn't relevant to the problem itself:

Communication failed.
 

Bob Hairgrove

Usenet Archive
Joined
Jun 26, 2003
Messages
620
Reaction score
0
When writing on such a subject, you should really use a newsreader that is capable to declare the encoding ("charset") in messages.
[..]
The problem is irrelevant to my newsreader.

If you're going to post to usenet, then I'd say Andreas offered good advice about doing it. And particularly if you're posting about character coding problems.

As we see, this shortcoming _was_ relevant to your description of the problem, even if it wasn't relevant to the problem itself:

Communication failed.

I see what you mean now ... Funny, though, Google shows the character correctly.

It's time everyone moved to Unicode, I suppose!
 

Alan J. Flavell

Usenet Archive
Joined
Jan 13, 2000
Messages
1,630
Reaction score
0
I see what you mean now ...
Thanks...

Funny, though, Google shows the character correctly.

Since there was no character coding defined, there -is- no independent definition of correctness. I think you really meant "Google made the right guess at what you meant", but Andreas (or rather, his software ;-) is more fastidious, and refused to guess.
It's time everyone moved to Unicode, I suppose!

With utf-8, you get a new form of excitement: if the octet-stream isn't valid utf-8, then it's forbidden to guess - the specification mandates the reporting of an error.

cheers
 

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
% Or does anyone have a URL handy to look up such things?

There's an RFC that lists a large number of character sets. I don't know the number off-hand, but a copy is included with the source for recode.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top