rejetto forum

Viewing, not downloading, HTML pages

Guest · 6 · 7434

0 Members and 1 Guest are viewing this topic.

LeandroTLZ

  • Guest
Hey,

A friend of mine gave me HFS via mail not long ago, and I really like it. While I know it wasn't meant to be a 'real' webserver, I'm using it like that to share files with friends. And here's the small problem I'm having: if I put HTML pages or TXT files in the virtual directory structure, HFS sends the Content-Disposition: attachment header, so browsers like Mozilla Firefox ask the user to download the file (IE just displays the page, but that's because IE never gave a damn about standards).

So... I'd like to know if there is an option to disable the Content-Disposition: attachment header based on MIME type or extension (or, if it could be added in a future release). I can't seem to find such an option in the MIME Types tab, where I think it belongs.

The above alone would make me a really happy camper, but the icing of the cake would be a simple toggle to 'Serve index.html if found instead of directory listing'.

Thanks for your time, great work, and read you later.


Anonymous

  • Guest
I am using Firefox 0.8 and HFS 1.6 rc 21
I haven't altered the mime types of either Firefox or HFS

When I click on an HTML file in Firefox, I see the webpage
When I click on a TXT file, I see the text
When I click on a JPG or GIF, I see the picture

It seems to be working ok for me

In HFS, when I click Menu, Other Options, MIME types,
there is an entry:

File Mask: *.htm;*.html
MIME Description: text/html

and

File Mask: *.txt
MIME Description: text/plain


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
leandro, that bug was fixed a long ago
but i don't remember when
try using last stable (1.5) and last beta (1.6)
i think at least one of them will work


Offline Mr. Anon

  • Tireless poster
  • ****
    • Posts: 270
    • View Profile
I too have the same problem. (rc26b)

GET /index.htm HTTP/1.1
Host: 127.0.0.1
Accept: */*
Connection: keep-alive

HTTP/1.1 200 OK
Content-type: text/html
Content-length: 100
Content-Disposition: attachment;  filename="index.htm"

I agree that we should have an option to remove the Content Disposition header for types of files since some also want to use HFS as a webserver.
Also is there a feature that allows index pages? ex. index.htm?

Comment: CAP the letters in bold and italics.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
Quote
While I know it wasn't meant to be a 'real' webserver
but it is meant to become it

Quote
HFS sends the Content-Disposition: attachment
it does only when the file does not match your MIME configuration.
you should double check your mime configuration, or just tell me the exact filename that is not working and open your HFS.INI and report the line startin with mime-types=.
BTW, i noticed there's a bug in the input for the mime configuration, so be careful.

Quote
based on MIME type or extension
that's what it's meant to do

Quote
'Serve index.html if found instead of directory listing'
already available in the unpublished 2.0
you will find soon a preview version on this forum

Quote
CAP the letters in bold and italics.
fixed in 2.0


Offline Mr. Anon

  • Tireless poster
  • ****
    • Posts: 270
    • View Profile