WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-26-2003, 11:34 AM
WebProWorld New Member
 

Join Date: Nov 2003
Posts: 2
bennym RepRank 0
Default Specifying a MIME type when opening a window

I want to open a file in a new browser window, in HTML (window.open). But because the file's extension is unknown to the browser, I get the 'specify application to use' dialog, wheras I know the file contains plain text and want it to open in a new browser window. Is there some way I can specify that the file should be treated as a text file (short of changing its extension)?

Thanks.
Reply With Quote
  #2 (permalink)  
Old 11-26-2003, 02:30 PM
mysticlighthouse's Avatar
WebProWorld Pro
 

Join Date: Jul 2003
Location: Louisville, KY
Posts: 186
mysticlighthouse RepRank 0
Default

try this... let's say that your site is http://www.foo.com and the file you want to display is blah.slp

in your window.open for the url use:

view-source:http://www.foo.com/blah.slp

that should work for you.

You're just wanting to have the browser look at the text file right?

If you want it to render as html then you should just be able to use http://www.foo.com/blah.slp in your window.open
__________________
Bryan DeNosky
Reply With Quote
  #3 (permalink)  
Old 11-26-2003, 11:27 PM
httpman's Avatar
WebProWorld Pro
 

Join Date: Aug 2003
Location: France
Posts: 196
httpman RepRank 0
Default

Bennym,

Are you using a Linux / Apache platform ?

If yes, you can specify tons of rules via a specific file called ".htaccess". Look there : http://wsabstract.com/howto/htaccess.shtml

You can specify which page to load when a user ask for a non-existing page (those pages which usually generate a "404 file not found" error), or - best suited in your case : which application should be launched which any file extension... Or also : which part of the site should be password protected. And so much more.

So many things which are available for free !! Enjoy.

JP
__________________
www.net-createurs.com [ french only website sorry ! ]
Reply With Quote
  #4 (permalink)  
Old 11-27-2003, 04:04 AM
WebProWorld New Member
 

Join Date: Nov 2003
Posts: 2
bennym RepRank 0
Default

Thanks guys - the view-source solution did the trick, alhtough that .htaccess info will be invaluable for another project I'm starting on.

Thanks again,
B
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0