Click here to get back home

file download using apache on HPUX

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
file download using apache on HPUX liorlew 08-10-2007
Posted by liorlew on August 10, 2007, 7:53 pm
Please log in for more thread options


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@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


Posted by Michael Vilain on August 10, 2007, 9:18 pm
Please log in for more thread options



> 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@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

What's in the web server error logs? Usually they give the reason why
there's an error.

--
DeeDee, don't press that button! DeeDee! NO! Dee...




Posted by David E. Ross on August 11, 2007, 1:43 pm
Please log in for more thread options


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@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>

Posted by Andy Dingley on August 13, 2007, 7:35 pm
Please log in for more thread options



>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).

Posted by André Gillibert on August 23, 2007, 3:32 pm
Please log in for more thread options


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.



--

Similar ThreadsPosted
epp - ie6 changes file name on download March 10, 2005, 1:18 pm
PDF "File Download" window? September 18, 2004, 5:06 pm
force download of a file February 3, 2006, 2:43 pm
Help: Download and Display a Text File January 1, 2005, 1:15 am
the web browser asks me if I want to download my index.htm file,instead of showing it July 30, 2004, 2:29 pm
Re: the web browser asks me if I want to download my index.htm file,instead of showing it July 30, 2004, 7:05 pm
Web service -> IIS and Apache rendering November 15, 2004, 10:59 am
Apache Content negotiation with Chinese zh-TW and zh-CN August 4, 2006, 3:11 pm
mime types in Apache and the validator June 6, 2008, 7:58 am
Warning: robots.txt unreliable in Apache servers October 30, 2005, 1:10 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap