I wrote a perl cgi script to search for files and return their full directory information. How would i open a new window, load the file regardless of the type and display it? I will be dealing with mostly pdfs, excel spreadsheets and text files. Will I have to check the file type and then handle each different file type? I tried this NewWindow=window.open(dir); where dir is something like file:///C:/cgi/00000T.txt im guessing window.open is only used for html refrences??? thank you!
window.open should work for anything. If you are using a web server to serve the pages, it should set the mime type based on the extension of the file, my guess is that since you are using file:// you might get different results
yes, set the context header to Excel type, or XML Type, or whatever type of file it is - do this before you do Anything else - and it will launch your script as that type of file.