SearchSearch   

file download using apache on HPUX

 
   Webmaster Forums (Home) -> HTML RSS
Next:  Standards for presentation of numerical data for ..  
Author Message
liorlew

External


Since: Aug 10, 2007
Posts: 1



(Msg. 1) Posted: Fri Aug 10, 2007 4:53 pm
Post subject: file download using apache on HPUX
Archived from groups: comp>infosystems>www>authoring>html (more info?)

Hello,

I am trying to write a program that will display all the file in a
given directory in UNIX; on a web page. I configured the APACHE on the
UNIX machine and I can access my default page, index.html.

the problem is that I put the following line in the html:
<html>
<head>
</head>
<body>
<a href="/files/myOutput.xls">Download myOutput.xls Now! (100kb
ZIP)</a>
</body>
</html>

I get the currect display, but when I click the link, the file doesn't
open and instead I get the message:
******************************************************************************************************************************
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, lior.lew RemoveThis @cingular.com and
inform them of the time the error occurred, and anything you might
have done that may have caused the error.

More information about this error may be available in the server error
log.

Additionally, a 403 Forbidden error was encountered while trying to
use an ErrorDocument to handle the request.
*******************************************************************************************************************************

in my configuration file I have the following:
<Directory "/home/ll3409/web/files/">
AddType application/vnd.excel xls (also tried ms-excel)
</Directory>

could someone please tell me what am I doing wrong?

Thanks,
Lior
Back to top
Michael Vilain

External


Since: Feb 07, 2007
Posts: 283



(Msg. 2) Posted: Fri Aug 10, 2007 6:18 pm
Post subject: Re: file download using apache on HPUX
Imported from groups: per prev. post (more info?)

This message is not archived
Back to top
David E. Ross

External


Since: Feb 18, 2006
Posts: 187



(Msg. 3) Posted: Sat Aug 11, 2007 10:43 am
Post subject: Re: file download using apache on HPUX
Archived from groups: per prev. post (more info?)

On 8/10/2007 4:53 PM, liorlew wrote:
> Hello,
>
> I am trying to write a program that will display all the file in a
> given directory in UNIX; on a web page. I configured the APACHE on the
> UNIX machine and I can access my default page, index.html.
>
> the problem is that I put the following line in the html:
> <html>
> <head>
> </head>
> <body>
> <a href="/files/myOutput.xls">Download myOutput.xls Now! (100kb
> ZIP)</a>
> </body>
> </html>
>
> I get the currect display, but when I click the link, the file doesn't
> open and instead I get the message:
> ******************************************************************************************************************************
> Internal Server Error
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
>
> Please contact the server administrator, lior.lew.TakeThisOut@cingular.com and
> inform them of the time the error occurred, and anything you might
> have done that may have caused the error.
>
> More information about this error may be available in the server error
> log.
>
> Additionally, a 403 Forbidden error was encountered while trying to
> use an ErrorDocument to handle the request.
> *******************************************************************************************************************************
>
> in my configuration file I have the following:
> <Directory "/home/ll3409/web/files/">
> AddType application/vnd.excel xls (also tried ms-excel)
> </Directory>
>
> could someone please tell me what am I doing wrong?
>
> Thanks,
> Lior
>

Do you have a MIME type definition for xls? In file .htaccess, add
AddType application/vnd.ms-excel xls

--

David E. Ross
<http://www.rossde.com/>.

Don't ask "Why is there road rage?" Instead, ask
"Why NOT Road Rage?" or "Why Is There No Such
Thing as Fast Enough?"
<http://www.rossde.com/roadrage.html>
Back to top
Andy Dingley

External


Since: Feb 14, 2004
Posts: 1110



(Msg. 4) Posted: Tue Aug 14, 2007 12:35 am
Post subject: Re: file download using apache on HPUX
Archived from groups: per prev. post (more info?)

On Fri, 10 Aug 2007 16:53:06 -0700, liorlew <liorlew.RemoveThis@gmail.com> wrote:

>I am trying to write a program that will display all the file in a
>given directory in UNIX; on a web page.

> <a href="/files/myOutput.xls">Download myOutput.xls Now! (100kb

So WTF is Excel doing there? Just serve plain text or HTML. Why not
use Apache's perfectly capable indexing facilities anyway ?

> Additionally, a 403 Forbidden error was encountered while trying to
> use an ErrorDocument to handle the request.

A 403 error?

Looks like the server doesn't like you trying to index a directory.
Check the DirectoryIndex entry in config.

>in my configuration file

httpd.conf? or .htaccess ? You can do it from either, but the syntax
is different. This is for httpd.conf

> I have the following:
><Directory "/home/ll3409/web/files/">
> AddType application/vnd.excel xls (also tried ms-excel)
></Directory>
>
>could someone please tell me what am I doing wrong?

What happens if you try the simple text files foo.txt and text.foo ?
The default settings will probably serve foo.txt as text/plain as they
already are. You can then try serving text.foo and checking that your
AddType directive can at least be applied to one simple file extension.

If there's no joy, check that AllowOverride in httpd.conf allows
..htaccess to be used (if you're using them).
Back to top
Dan

External


Since: Jun 01, 2007
Posts: 15



(Msg. 5) Posted: Sat Aug 18, 2007 9:08 am
Post subject: Re: file download using apache on HPUX
Archived from groups: per prev. post (more info?)

On Aug 10, 7:53 pm, liorlew <lior... DeleteThis @gmail.com> wrote:
> <a href="/files/myOutput.xls">Download myOutput.xls Now! (100kb
> ZIP)</a>

If it's a .xls file (yuck, M$ proprietary!), why does the link text
claim it's a ZIP?

--
Dan
Back to top
André Gillibert

External


Since: Aug 23, 2007
Posts: 4



(Msg. 6) Posted: Thu Aug 23, 2007 9:32 pm
Post subject: Re: file download using apache on HPUX
Archived from groups: per prev. post (more info?)

Andy Dingley wrote:

> So WTF is Excel doing there? Just serve plain text or HTML. Why not
> use Apache's perfectly capable indexing facilities anyway ?
>

IIRC, this "perfectly capable" indexing facility generate invalid tag soup
with IMG and HR inside a PRE element.



--
You can contact me at <tabkanDELETETHISnaz.TakeThisOut@yahoDELETETHATo.fr>
Back to top
Nick Kew

External


Since: Feb 27, 2007
Posts: 11



(Msg. 7) Posted: Fri Aug 24, 2007 12:56 am
Post subject: Re: file download using apache on HPUX
Archived from groups: per prev. post (more info?)

On Thu, 23 Aug 2007 21:32:34 +0200
"André Gillibert" <tabkanDELETETHISnaz.DeleteThis@yahodeletethato.fr> wrote:

> Andy Dingley wrote:
>
> > So WTF is Excel doing there? Just serve plain text or HTML. Why
> > not use Apache's perfectly capable indexing facilities anyway ?
> >
>
> IIRC, this "perfectly capable" indexing facility generate invalid tag
> soup with IMG and HR inside a PRE element.

Details, please. If Apache does that, we should know.

[Not counting the junk that gets shipped with certain distros under
such preposterous names as "advanced extranet server"].

--
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/
Back to top
André Gillibert

External


Since: Aug 23, 2007
Posts: 4



(Msg. 8) Posted: Fri Aug 24, 2007 7:29 pm
Post subject: Re: file download using apache on HPUX
Archived from groups: per prev. post (more info?)

Nick Kew wrote:

> Details, please. If Apache does that, we should know.
>

I noticed that with Apache 2.0.54, *by default*, directory indexing
produces an ugly PRE element containing an HR element as well as one IMG
for every file.
Moreover using PRE for tabular data in an HTML 3.2 document is ugly. HTML
3.2 has tables.

As a sample: Look at the source code at that URI:
http://www.apache.org/dist/httpd/binaries/
It's generated by Apache 2.3.0 (August 24, 2007, 17:00 UTC).

However, I looked at the source code of Apache 2.2.4 (the latest stable
release) that I directly downloaded from apache.org.

The C file httpd-2.2.4/module/generators/mod_autoindex.c contains the
guilty tag soup generator.
I noticed that a tabular layout, with proper HTML tables, was generated if
a flag TABLE_INDEXING was set.
So, I read (searched into) the friendly manual (I should have started with
that, but was too lazy), and quickly found that the parameter HTMLTable of
the option IndexOptions, activates the "good" index generator.

http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexoptions

It's marked as "Experimental, Apache 2.0.23 and later", but it works quite
well.

My statement about tag soup was mainly related to the fact everytime I see
an Apache directory on the WWW (in Year 2007), it uses the old PRE tag
soup....
As you see, Apache's website is not exception to this rule.

But, that doesn't change the fact that Apache can generate valid HTML code
(which seems to be conforming, tough there's one ugly thing with <hr>), if
fed with the right options.
So, there's no reason not to use the Apache indexing facility on releases
over 2.0.23.

PS: All the tests have been done on GNU/Linux, in an i386 environment,
with the Fedora Core 4 distro.
--
You can contact me at <tabkanDELETETHISnaz.RemoveThis@yahoDELETETHATo.fr>
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> HTML
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum