Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2006, 02:37 PM
Registered User
 
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mime types

I am able to write a (client-side) page that writes a file with a .sql extension. I can edit the file with notepad and everything looks okay. When I try to open it with javascript, it displays rubbish on the screen. When I rename the same file to have a .txt extension, the javascript works fine. below is my open and save code.
Thanks...

function doSave() {
    var win = window.open('', '_blank', 'top=10000');
    win.document.open('text/html', '_blank');
    win.document.charset="iso-8859-1";
    win.document.writeln(form1.textarea1.value);
    win.document.execCommand('SaveAs',true,'dbnet.sql' );
    win.close();
}

function doOpen() {
   var theFile=document.form2.InputFile.value;
   theNewFile=theFile.replace(/\\/g, "\\\\");
   var thisFile = new ActiveXObject("Scripting.FileSystemObject");
   var ReadThisFile = thisFile.OpenTextFile(theNewFile,1,false);
   var txtFile = ReadThisFile.ReadAll();
   document.form1.textarea1.value=txtFile;
   ReadThisFile.Close();
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
How i can convert MIME format data in HTML. rajendradhanora ASP.NET 1.0 and 1.1 Basics 0 April 29th, 2006 07:22 AM
MIME attachments in PHP vibinkrish Beginning PHP 0 March 9th, 2006 07:45 AM
MIME attachments - line length limit aditya.ch Biztalk 0 May 23rd, 2005 02:23 AM
Types DARSIN Oracle 2 February 5th, 2005 12:14 AM
MIME Attaching PDF file jer99 Pro PHP 1 August 18th, 2003 02:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.