httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <krist.vanbes...@gmail.com>
Subject Re: [users@httpd] How to make a website like ftpsite?
Date Fri, 30 Nov 2007 13:07:41 GMT
On Nov 30, 2007 11:21 AM, goommy <iloveyunxuan@gmail.com> wrote:
> users,您好!
>
> What my mean is not mod_ftp !!
> It's just a experiment to study apache !
> What i want to do is make a website like ftpsite:after open the URL i can see the file
list
> and i can download all files!
> First.i use "Options Indexes" and "DirectoryIndex none" list the all file!
>     By default, when i click on the file, some types can brows directly(just like *.html
*.txt *.gif *.jpg ...) and some other types will prompt download dialog for choosen(like *.tar.gz
*.mp3 and so on). So i want to try when click on *.html it also appear the prompt dialog for
choosen!
>     And i found 【If the media type remains unknown, the recipient SHOULD treat it as
type "application/octet-stream".】on rfc2616! So i think maybe i can get the result by change
the response header!!(qu.1: Is it a right idea?)
>     So i set   <VirtualHost 125.35.14.229:80>
>                                 DocumentRoot /opt/webdata/www2cn
>                                 ServerName www2.putiantaili.com.cn
>                                 DirectoryIndex index.none
>                                 <Directory "/opt/webdata/www2cn/download-dir">
>                                 #try to : all files download only ,can't browser with
IE
>                                 Options Indexes FollowSymLinks
>                                 Header set Content-Type application/octet-stream
>                                 Header append 123-Type 123
>                                 AllowOverride All
>                                 Order deny,allow
>                                 allow from all
>                                 </Directory>
>                            </VirtualHost>
> But the result is failure! (very depressed!!)
> And the reponse header is :
> HTTP/1.0 200 OK
> Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.7a
> ETag: "97b7d-2d-75d78680"
> Accept-Ranges: bytes
> Content-Type: text/plain     (why not application/octet-stream)
> 123-Type: 123                            (123-type header set )
>
> And qu.2 : How to make a website like ftpsite?  Thank you for your help!!!
> (This experiment takes me a long time and halt)

What browser are you using? Internet explorer has been know to ignore
the content type header.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?
Mime
View raw message