-
1. Re: Downloads with
peterj Sep 12, 2007 11:46 AM (in response to aakjpe)Is this what you are looking for: http://wiki.jboss.org/wiki/Wiki.jsp?page=ExternalDirectories
-
2. Re: Downloads with
aakjpe Sep 13, 2007 2:33 AM (in response to aakjpe)Not exactly. When I used Orion server this was not a problem at all. I could make the refenense in the .jsp file like this: http::/server:1080/kjell/dir/files/result.xls and the user clicked the link, and did "save targer as...".
But it seems to be more complicated in JBoss. -
3. Re: Downloads with
peterj Sep 13, 2007 11:46 AM (in response to aakjpe)By defining an external directory, you can supply a similar URL to enable downloads. All it takes is a simple configuration change.
For example, update the 'Host name="localhost"' entry in server.xml as follows:<Host name="localhost" ...> <Context path="/docs" appBase="" docBase="/home/foo/docs" debug="99" reloadable="true"> </Context> ... </host>
Then if there is a file /home/foo/docs/design/xxx.odt, you can access it using http://hostname:8080/docs/design/xxx.odt. -
4. Re: Downloads with
aakjpe Sep 13, 2007 12:38 PM (in response to aakjpe)Which server.xml file? I find at least 2 files. In ../server/all/deploy/jboss..tomvatt.sar and
in ../server/default/.....
Does the JBoss server have to be restarted? -
5. Re: Downloads with
peterj Sep 13, 2007 1:37 PM (in response to aakjpe)The server.xml for the configuration you are running. If you don;t run a specific configuration, then the one in 'default'.
Yes, you must restart the server. -
6. Re: Downloads with
aakjpe Sep 14, 2007 3:35 AM (in response to aakjpe)It worked! I can now download files from the exteral directory. One small problem: The files are of type .xls, but when the download dialog box appears the filetype is set to .htm. Anything I can do to change the filetype? The refererence in <a href.. is filename.xls
-
7. Re: Downloads with
peterj Sep 14, 2007 11:16 AM (in response to aakjpe)Try adding type="text/xml" to your < a > tag.
-
8. Re: Downloads with
aakjpe Oct 2, 2007 3:40 AM (in response to aakjpe)I have tried several combinations of type, type = "text/xml" "text/xls"
"xls", but the save dialog still use the filetype .htm
Any hints? -
9. Re: Downloads with
aakjpe Oct 2, 2007 9:12 AM (in response to aakjpe)Her is how the html code is using view source:
<a href="Reports/ActiveUsers.xls" type="text/xml" target=_blank>Rapporten i excel-format ( Save Target As...)
If I take a "copy shortcut", the link looks like this:
http://padda-o1:1080/PaddaUserAdm/Reports/ActiveUsers.xls
But "Save as...", still names the file ActiveUsers.htm.
I have to rename the file to ActiveUsers.xls, and can then load the file into excel. -
10. Re: Downloads with
peterj Oct 2, 2007 11:25 AM (in response to aakjpe)Sorry, I read the extension as .xml, not .xls. Try a type of "application/vnd.ms-excel".
-
11. Re: Downloads with
peterj Oct 2, 2007 11:29 AM (in response to aakjpe)Another thing to try. Add the following to the long list of mime types in server/xxx/deploy/jboss-web.deploy/conf/web.xml file:
<mime-mapping> <extension>xls</extension> <mime-type>application/vnd.ms-excel</mime-type> </mime-mapping>
-
12. Re: Downloads with
aakjpe Oct 3, 2007 2:09 AM (in response to aakjpe)At last it worked! Setting mime type in the web.xml file did it.
Thank you very much for the help you have provided.