Serving Text files without html extension as html pages

I have a large site that has a number of legacy html files with no extensions. The site was running under 10.3 just fine. Just reinstalled 10.4 and now these pages are rendered as plain text in the browser.
I've tried adding a blank entry in the extensions under the text/html mime/type setting but doing so creates an error which stops the server. I've got hundreds of these files stored for several years that I don't want to go back through and add a .html on the end of.
How can I get the web server to treat a file without an extension as an html file?

I know this isn't an answer to the question you're asking, but are you sure you want that behavior? There might be times where you want an extensionless file to be loaded as a plain text file. At the very least, it will help make your site more compatible.
If all these files are collected in the same area on your system, it might be best to give them the .html extension.
You can do this relatively painlessly with virtually any scripting language. I know I've even seen an AppleScript that will go through a batch and change the extension for you. You might want a modified one that will first check for the start/end HTML tags in the file first to make sure you're only changing HTML files. A quick Google search for scripting a filename change will probably yield lots of results (check Perl and PHP resource sites as well).

Similar Messages

  • Is it possible to read/write to text file without deleting it?

    I know how to read from a text file and how to write to a text file. The problem that i have is i need to use a text file to store data for my application to read and also for my application to write. I would like it if i could write two programs really, one reads, the other is used to update the text file. This file is a list of verbs. I thought about using databases but i couldn't get them to work. I downloaded MySQL server 5.0 and installed it. I then downloaded the driver from http://www.mysql.com/products/driver and ran the auto installer. it said everything worked out perfectly but when i try these lines:
    Class.forName("com.mysql.jdbc.Driver");
    I get a SQLException that says no suitible driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    ( I thought this driver came with the JDK but i guess not, i just read about it in a java book)
    I get a ClassNotFoundException
    that just says sun.jdbc.odbc.JdbcOdbcDriver
    So yeah, SQL is pretty much not working. I need a solution to my problem, either by using text files, or a different type of database. I heard you could use excel to create a database but i have no idea how and i hear microsoft access could also do this, however i don't have microsoft access and i don't intend on paying for it. So, here are my questions:
    1st, is there a tutorial on using excel databases in java programs
    (if not)
    2nd is there a way to read/write/update a text file without deleting it?
    (if not)
    3rd is there a way to get SQL working, i have windows vista this could be the problem
    (if not)
    4th what could i do to store information on the hd for reading and modifying later?
    thanks, lateralus

    A database might be overkill just for a list of words.
    Thoughts:
    <ul>
    <li>What is the extent of your "file updating"? If you are just appending to the file, opening it in append mode will keep the file from being clobbered.</li>
    <li>Otherwise, why not create new files instead of editting them? The file names could include a version number or timestamp, allowing the reader to select the newest one.
    </li>
    </ul>

  • How to open an InDesign file without .indd extension?

    Hi,
    I am trying to open an InDesign file which does not have the extension .indd.
    I can open the file from InDesign's File-> Open menu item. But if I try to open programmaticaly it says the file format is not supported.
    I tried using SDKLayoutHelper::OpenDocument and IDocumentCommands::CreateOpenCommand both gives the same error.
    Thanks,

    Thanks. My file was not proper. I am able to open the file without the extension.

  • Proc*C/C++ suport for include files without .h extensions

    We have written code C++ code which is Standard C++ ver 5.0 compilant. In this version of C++ compiler the files are without .h extensions. For example <iostream.h> is now to be reffered as <iostream>. We are facing problems in compiling this code with PCC compiler
    Sample Code:
    File test1.h
    #ifndef TEST1H
    #define TEST1H
    #include<iostream>
    #include<list>
    class test
    private:
    int i;
    public:
    int k;
    #endif
    File test1.pc
    #include <iostream>
    #include<test1.h>
    int main()
    int i;
    std::cout << "Enter a value :";
    std::cin >> i;
    std::cout << std::endl;
    return 0;
    When this code is compiled with Code=cpp CPP_SUFFIX=cpp PARSE=PARTIAL options we get the following errors
    Pro*C/C++: Release 8.1.5.0.0 - Production on Fri Feb 1 12:46:00 2002
    (c) Copyright 1999 Oracle Corporation. All rights reserved.
    System default option values taken from: /oracle8/app/oracle/product/8.1.5/precomp/admin/pcscfg.cfg
    Error at line 2, column 10 in file test1.pc
    #include <iostream>
    .........1
    PCC-S-02015, unable to open include file
    Error at line 3, column 9 in file test1.h
    #include<iostream>
    ........1
    PCC-S-02015, unable to open include file
    Error at line 4, column 9 in file test1.h
    #include<list>
    ........1
    PCC-S-02015, unable to open include file
    I guess so PCC compiler does not identify include files without .h extension.
    Lata

    Do you have the SUNWhea package on your system? This package contains the headers you seem to be missing. It's on the Solaris 8 CDROM 2 of 2. If you don't know how to add packages from the CDROM, look up "Adding and Removing Software After Installing Solaris 8" in the "Solaris 8 Advanced Installation Guide" on docs.sun.com.

  • How can I write a checkbox.label into a server text file?

    Hello, world...
    I have a problem...
    I need to write into a server text file the label of the selected checkbox..
    The client side script is:
    private function writeFile (e:MouseEvent):void
                 if (cb1.selected == true && writeBtn.label == "Conferma")
                     nc.call ("WriteNow",null,"La lettera iniziale è:"+cb1.label+"\n");
                     writeBtn.label = "Fatto";
                 else if (cb2.selected == true && writeBtn.label == "Conferma")
                      nc.call ("WriteNow",null,"La lettera iniziale è:"+cb2.label+"\n");
                     writeBtn.label = "Fatto";
                 else if (cb3.selected == true && writeBtn.label == "Conferma")
                       nc.call ("WriteNow",null,"La lettera iniziale è:"+cb3.label+"\n");
                      writeBtn.label = "Fatto";
    ...and the server side script is:
    var anVis = new File("Analisi_Visiva.txt");
    fileWriter.WriteNow = function(cliMsg)
            anVis.open("text", "append");
            if (anVis.isOpen)
                 anVis.write(cliMsg);    //line 17.
                 anVis.close( );
    I have this error in the Live Log of the FMS3 Administration Console:
    Sending error message: C:\Programmi\Adobe\Flash Media Server 3\applications\AnalisiVisiva\AnalisiVisiva.asc:line 17:File operation write failed.
    Why doesn't It work?
    Please, help me...
    Emiliano.

    Hello,
    In order to download your internal table just call the following fm:
      CALL FUNCTION 'TB_LIMIT_WS_DOWNLOAD'
       EXPORTING
      BIN_FILESIZE                  = ' '
         filename                      = dest
         filetype                      = 'ASC'
         mode                          = 'O'
       IMPORTING
         filelength                    = filesi "Bytes read
        TABLES
          data_tab                      = p_ti_temp "your IT
       EXCEPTIONS
         file_write_error              = 1
         invalid_filesize              = 2
         invalid_type                  = 3
         no_batch                      = 4
         unknown_error                 = 5
         gui_refuse_filetransfer       = 6
         no_authority                  = 7
         OTHERS                        = 8
    Hope this helps
    Gabriel

  • Proc*C/C++ support for header files without .h extension.

    Does Pro*C/C++ compiler suppport include files without .h extensions.??
    The following code written in a .pc file, which is compilant to Standard C++ 5.0 standards when compiled with Pro*C/C++ compiler to generate a .cpp gives errors
    #include<isotream>
    int main()
    std::cout << "Test";
    return(1);
    On compilation it gives following problems:
    #include <iostream>
    .........1
    PCC-S-02015, unable to open include file
    Standard C++ version 5.0 has all the include files without .h extension. Does any version of Pro*C/C++ support that?
    Lata

    The normal way to handle this is with the -I option on the compile line:
    cc -I/usr/ucbinclude -c myprog.c ...
    Is there a reason you can't use the -I option?

  • Write to text file without server side

    Hi,
    I need to write data into a text file for saving data from my
    flash movie, but I didn't have the possibility to use a
    server-side.
    Because my flash movies are stored on a CD and it must be
    compatible with Windows and MacOS.
    Is it possible to write data into a text file?
    If no, can I use a third party software? Which one?
    Regards
    YamNet

    A SharedObject might work for you. Otherwise, you'll need a
    'wrapper' app.
    Adobe's own Director works very well for this, and AIR would
    work as well.
    There are also a good number of 3rd party apps, such as Zinc
    and others.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How do I open old files without application extensions on them?

    I have lots of 1995 or so files written from a mac on 3.5 diskets most of which I have read onto disk.
    But they have no extensions and I can't seem to open them.
    If I had to guess I would say they are canvas, possibly powerpoint but using powerpoint 98and canvas 7 I can"t seem to open them.
    I have a G3 powerbook.  a G3 tower both running OS9, a powerPC macmini running OS10 and OS9 in emulation, a PC portable running System10 and another PC portable running XP.
    What are my options short of seppuku?
    I need to get these files to teach a course.
    Thanks

    When I use OS 9 and previous Mac systems I use CanOpener for problems such as you present. It is still available too.
    http://www.abbottsys.com/co.html
    Use CanOpener to get into just about any file.
    Powerful Mac data recovery software. Our famous universal file opener lets you read any file -- and extract what you need including text, icons, PICS and more. It's perfect for browsing all types of files, including old files, foreign files and files your Mac can't open, and it's indispensable for recovering text from damaged files - a lifesaver!
    Plus, CanOpener lets you view virus infected files without launching the virus. So you can safely check suspect files and recover text from them - a powerful way to avoid virus infections!
    CanOpener has special text filters that let you...
    *Extract Names, Phone Numbers, URLs, Email, Web and IP Addresses.
    *Strip HTML Coding. Remove extra Carriage Returns and blank spaces from email and Web text.
    *Extract important sentences such as questions or anything containing $'s and numbers.
    *Rapidly find clean text in files that contain huge amounts of 'garbage'
    CanOpener Extractor.
    Now you are not limited to opening files individually. You can drag and drop any file, or a folder full of files, to do bulk extraction using any of the special text extraction filters! A fantastic time saver!

  • How to generate reports in text file without totals

    Hi!!!
    Does anybody knows how can I generate a report in text file
    (separated by |), but without the lines with totalizations ?
    In my application, the user can choose if he wants the output
    in HTML,PDF or a text file. So, the solution to this question
    must be implemented in code.
    Thanks a lot,
    Anderson.

    If you put a formatting trigger on any item or frame and return FALSE, it will disappear.
    So the totals need to be within a frame which has a trigger which returns false if text file is chosen.

  • All files without .indd extension corrupted

    Being a Mac user, I never bothered appending the .indd extension to my InDesign files, because I never needed to (or so I thought). However, after working on lots of projects and archiving them to DVD, it seems that any InDesign files without the .INDD extension are now corrupt!
    If I try to open any them, I'm given the unhelpful "Cannot open the file xxx. Adobe InDesign may not support the file format, a plug-in that supports the file format may be missing, or the file may be open in another application" message.
    The files were originally created in CS2 on Mac OS 10.4.x (I think), but now I am using CS4 on Mac OS 10.6.x. I have tried adding the .indd extension (which gives the file it's InDesign icon, rather than a generic blank document icon) and opening it on the original Mac, but to no avail.
    I have loads of these file, which are all exactly the same! Can anybody help, please?

    John-Lee Langford wrote:
    Being a Mac user, I never bothered appending the .indd extension to my InDesign files, because I never needed to (or so I thought). However, after working on lots of projects and archiving them to DVD, it seems that any InDesign files without the .INDD extension are now corrupt!
    If I try to open any them, I'm given the unhelpful "Cannot open the file xxx. Adobe InDesign may not support the file format, a plug-in that supports the file format may be missing, or the file may be open in another application" message.
    The files were originally created in CS2 on Mac OS 10.4.x (I think), but now I am using CS4 on Mac OS 10.6.x. I have tried adding the .indd extension (which gives the file it's InDesign icon, rather than a generic blank document icon) and opening it on the original Mac, but to no avail.
    I have loads of these file, which are all exactly the same! Can anybody help, please?
    It's not clear if you're trying to open the files by double clicking  on them in Finder, by Right/Option-click > Open, Right/Option-click  > Open with, by dragging them to the InDesign icon in the Dock,  dragging them into the open InDesign workspace, or by using File >  Open.
    Are you using the same user account, same installation as the files were created with, and opening the un-renamed files on the old machine's hard drive (not on a network server or CD/DVD) with File > Open, or are you using another method? Do you get different results with different methods ? Do you get the same message on both the CS2 and CS4 installations on their respective machines?
    Have you tried all of these on original files, not the renamed ones? Same or different results with any or all?
    Have you been successful in creating a new InDesign CS4 file and saving it, closing it, then opening it by one or more of the above-mentioned methods? Results?
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • IDCS3_Saving files without .indd extension!

    I am trying to save CMYK InDesign files to a "hot folder" on our network. The contents of the hot folder are converted to a Postscript file then processed through a computer that separates the color information and sends the info to 2 places: 1) a plate machine (creates plates for a web press) 2) a C.I.P. (color ink position) file that goes to the web-press' computer to tell it where the color needs to be.<br /><br />I can get plates to come out fine, however, the .indd extension seems to make the CIP files unreadable to the Press computer.<br /><br />How can I save the InDesign files without the .indd extension. If I simply delete the extension, it shows up anyway as it goes through the rip computer and adds a .ps extension at the end.<br /><br />(ex: CMX20080416A01.indd.ps / it needs to read:CMX20080416A01.ps <note: the .ps is added by the rip computer>)<br /><br />We are able to achieve this in CS2, but that was set up before I started here, and nobody else can seem to remember how it was done.<br /><br />THANK YOU IN ADVANCE FOR ANY ADVICE/INSIGHT!

    Easiest way would just be to strip them off in the Finder with a script. InDesign is probably dead intent on keeping them since they are the only true way to identify file type in OS X.
    Activate folder actions on a folder on your Desktop
    Attach this script action into ~/Library/Scripts/Folder Script Actions and attach it to the folder you created:
    on adding folder items to this_folder after receiving these_items
    tell application "Finder"
    set AppleScript's text item delimiters to ""
    set myItems to every file of folder this_folder whose name extension = "indd"
    repeat with thisItem in myItems
    set trimmedName to name of thisItem
    set trimmedName to characters 1 thru -6 of trimmedName
    set trimmedName to trimmedName as string
    set name of thisItem to trimmedName
    end repeat
    end tell
    end adding folder items to
    Duplicate the indd docs there and they should be renamed without .indd

  • Flash Player Installer downloads from the Adobe distribution site as a generic file without an extension and the file won't open.

    Hi, everyone.
    When I download Flash Player Installer from the Adobe distribution site Adobe Flash Player Distribution | Adobe the file downloads to my hard drive as a generic file with no extension, and Windows can't determine which program to use in order to open/play the file. I am using Windows 7 Professional 64 bit.
    Is there something wrong with the downloaded file? Or am I missing required software?
    Thank you for your time,
    -Brandon

    Yes, I've never had a problem before. I've even downloaded the Flash Player Install files from the Adobe distribution site on multiple occasions in the past without issue. The only thing I could think of is that perhaps the ".exe" extension was left off to avoid triggering security measures on a computer or private network that would prevent the download.
    Anyway, it worked after I added the ".exe" extension to the filename, so I have no complaints!

  • How to open a text file without using dialog box

    I can open a file using dialog box but I want to open a file without using any dialog box for writing.
    With the following commands a new file is created.
    File outputFile = new File("outagain.txt");
    FileWriter out = new FileWriter(outputFile);
    I want to open an existing file and put some more text in it using FileWriter or any other object
    rgds,
    Arsalan

    import java.io.*;
    class UReader
        BufferedReader in;
        BufferedReader input;
        String fileName;
        public UReader(String fileName)
            this.fileName = null;
            this.fileName = fileName;
            try
                in = new BufferedReader(new FileReader(fileName));
                input = new BufferedReader(new FileReader("A.b"));
            catch(IOException _ex) { }
        public final String getContent()
            String txt = "";
            try
                while(in.ready())
                    txt = txt + in.readLine();
                    txt = txt + "\n";
                in.close();
                txt.trim();
            catch(IOException _ex) { }
            return txt;
        public final String getLine(int row)
            try
                input = new BufferedReader(new FileReader(fileName));
            catch(IOException _ex) { }
            String txt = null;
            if(row <= getRows()) {
                try
                    for(int i = 0; i < row; i++)
                        txt = input.readLine();
                    input.close();
                catch(IOException _ex) { }
            } else {
                txt = "Index out of Bounds";
            return txt;
        public final int getRows()
            try
                input = new BufferedReader(new FileReader(fileName));
            catch(IOException _ex) { }
            String txt = null;
            int rows = 0;
            try
                while(input.ready())
                    txt = input.readLine();
                    rows++;
                input.close();
            catch(IOException _ex) { }
            return rows;
    import java.io.*;
    import java.util.*;
    class UWriter
        PrintWriter out;
        String fileName;
        String[] txt;
        static int NEW_LINE = 1;
        static int APPEND = 0;
        public UWriter(String s)
            fileName = null;
            txt = null;
            fileName = s;
            try
                out = new PrintWriter(new BufferedWriter(new FileWriter(s, true)));
            catch(IOException ioexception) { }
        public final void addContent(String s, int i)
            int l = 0;
            StringBuffer sb = new StringBuffer(s);
            s.replaceAll("\n\n", "\n###\n");
            StringTokenizer str = new StringTokenizer(s, "\n");
            String token = null;
            while (str.hasMoreTokens()) {
                ++l;
                token = str.nextToken();
            str = new StringTokenizer(s, "\n");
            txt = new String[l];
            int k = 0;
            String test;
            while (str.hasMoreTokens()) {
                test = str.nextToken();
                if (test.equals("###")) test = "";
                txt[k++] = test;
            if(i == 0) {
                try
                    for (int j = 0; j < txt.length; ++j) {
                        out.println(txt[j]);
                    out.close();
                catch(Exception ioexception) { }
            } else {
                try
                    out.println();
                    for (int j = 0; j < txt.length; ++j) {
                        out.println(txt[j]);
                    out.close();
                catch(Exception ioexception1) { }
        public final void writeContent(String s)
            int l = 0;
            s.replaceAll("\n\n", "###");
            StringTokenizer str = new StringTokenizer(s, "\n");
            String token = null;
            while (str.hasMoreTokens()) {
                ++l;
                token = str.nextToken();
            str = new StringTokenizer(s, "\n");
            txt = new String[l];
            int k = 0;
            String test;
            while (str.hasMoreTokens()) {
                test = str.nextToken();
                if (test.equals("###")) test = "";
                txt[k++] = test;
            try
                PrintWriter bufferedwriter = new PrintWriter(new BufferedWriter(new FileWriter(fileName, false)));
                for (int j = 0; j < txt.length; ++j) {
                    bufferedwriter.println(txt[j]);
                bufferedwriter.close();
            catch(IOException ioexception) { }
    }Maybe they are not the best codes, i wrote them a long time ago, so dont ask why i did anything wierd. :D
    But anyway it works.

  • Reading text files without specifying the encoding?

    I have looked everywhere for a solution, but I can't find one. The problem is that I'm using codes that everybody is using, but for some reason, my codes aren't working.
    I want to be able to open up text files in Java without having to specify the encoding for the files that I'm going read, because I have no idea which encoding they will use.
    But even when specifying UTF-8 to be encoding of the file to read, it doesn't work correctly:
    FileInputStream fileIS= new FileInputStream("somefile.txt");
    Reader reader = new BufferedReader(new InputStreamReader(fileIS, Charset.forName("UTF-8")));
    EVERYWHERE I look, ppl are using these codes! But it doesn't work, some characters (such as the Euro sign) are displayed as squares.
    However, I want to be able to read not only UTF-8 files but anything that Java supports. Any ideas?
    Edited by: Stalfos on Oct 22, 2007 12:22 PM

    Stalfos wrote:
    I want to be able to open up text files in Java without having to specify the encoding for the files that I'm going read, because I have no idea which encoding they will use.
    This is your problem. If you don't know what encoding the text is stored in, then the chances that the default encoding used to read it will be correct are slim.
    But even when specifying UTF-8 to be encoding of the file to read, it doesn't work correctly:There are many different character encodings, and most of them don't overlap. Anything above 127 usually causes problems.
    FileInputStream fileIS= new FileInputStream("somefile.txt");
    Reader reader = new BufferedReader(new InputStreamReader(fileIS, Charset.forName("UTF-8")));
    EVERYWHERE I look, ppl are using these codes! But it doesn't work, some characters (such as the Euro sign) are displayed as squares.The problem isn't with the code, it's that the file you're reading isn't using an encoding that's compatible with UTF-8. Assuming that using UTF-8 should work for all encodings is like assuming that someone who can read Chinese should be able to read a book written in Spanish or Greek. It doesn't work that way.
    However, I want to be able to read not only UTF-8 files but anything that Java supports. Any ideas?You need to know what encoding your files are stored in, period. There are a few ways to guess what the encoding is, but they're only reliable for a small set of encodings.
    You don't seem to truly understand what character encodings are, or how to use them, so read this:
    The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
    http://www.joelonsoftware.com/articles/Unicode.html

  • How to export to text file without ruin the format

    Hi guys,
    I need some help here. My company recently come with the decision to print the mainframe report file that usually come as a text file, to a virtual printer. This virtual printer is printing the report as Adobe PDF format. The problem is, my Line of Business have a macros on Excell file that will grab the information from the text file to be processed in the Excell format. I tried to use Adobe Professional 8 to re-convert the PDF file to be text file, but the result is, most of the blank space is gone, and it is align to left, thus make it unusable to the Excell file.
    Unfortunately, I can't provide you the sample of the document, because it contain classified customer info.
    But appreciate if you can give me some advice.
    Thanks and Regards.

    It sounds as if you are dealing with untagged PDF.
    Tagged output PDFs, with a well-formed structure, provide (amoung other things) the ability to Save As/Export
    content to some other applications with all or most of the layout/format intact.
    I suspect that the output PDFs you have are untagged.
    As there is, currently, a rather limited number of applications that support adequate tag management
    (FrameMaker, InDesign, MS Word (via Adobe's PDFMaker & to a much lesser extent with Office Save As to PDF - XPS)
    I suspect the mechanism used to provide your PDFs won't cut it with regards to providing a tagged output PDF having a
    well-fomed structure (which would include dictionaries containing format/layout data).
    As alluded to by Bernd, there may be third party plug-ins that might help.
    The more reliable/functional ones tend to not be inexpensive.
    Be well...

Maybe you are looking for

  • User not able to connect to the WIreless

    We are facing the issue with a client he is getting the Ip but we are not able to ping even it fails to get the lenk test from the WLC.AP is registered to the Centralised WLC and other users are able to get the access with out any problem .Below are

  • Changing encoding to "CP1252" in B2B Adapter

    Hi Experts, Issue is regarding the change in encoding to "CP1252". 1) We are having special characters in our payload which were not read by UTF-8 so it was failing in mapping. After we changed the same to CP1252 using below XSL code it worked fine a

  • Can not hear audio for tv episode

    I have iTunes 8.0 and it was working fine, but I bought a tv episode today and when I go to play it i can't hear any sound. I can hear my other tv shows but this one episode does not work. any ideas on to what could be the problem

  • How to read response header

    Hi, We are using Fiori framework and directly binding a odataservice(entity of a odata service) to a table like following <Table id="dTable" mode="MultiSelect" updateStarted="handleStarted"    items="{/testCollection}" selectionChange="enableDisableB

  • Apps in italian instead of french?

    I live in France. My apps appear in italian langage. How can i have them back in   french? Thanks for your help!