| Author |
Web logic server file direct download
|
sujith delpachithra
Greenhorn
Joined: Oct 14, 2008
Posts: 12
|
|
Hi,
i am new to weblogic server.
i want my web clients to direct download file in a weblogic server. like sun app server docroot.
Users should be able to type "http://url.com/test.txt" to download the files. if any one knows how to do this, please help me.
thanks,
sujith.
|
 |
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
|
|
You can use virtual directory mapping to accomplish this. (weblogic.xml tag)
http://edocs.bea.com/wls/docs103/webapp/weblogic_xml.html#wp1039396
[]s
|
 |
sujith delpachithra
Greenhorn
Joined: Oct 14, 2008
Posts: 12
|
|
thanks for the reply.
in order to your reply, i tried editing weblogic.xml file. but it didn't work.
suppose i have a file in "d:\test\t.pdf".
i used the below code fragment to achieve you proposed.but i was failed.
<virtual-directory-mapping>
<local-path>D:/</local-path>
<url-pattern>/test/*</url-pattern>
<url-pattern>*.pdf</url-pattern>
</virtual-directory-mapping>
please, help me with more details.
thanks again
|
 |
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
|
|
How is the url you're using to get the file?
Long time since I've done this.. but as far as I remember....
You'll problably need to add the pattern you've mapped with url-pattern tag to your url, like: http://localhost/test/yourFile.pdf
When pointing in weblogic.xml file try to pass complete path from files like:
Let me know if worked, ok???
[]s
|
 |
sujith delpachithra
Greenhorn
Joined: Oct 14, 2008
Posts: 12
|
|
which "weblogic.xml" file should i edit? in weblogic server there are a few files calles as "weblogic.xml".
waiting for kind response
thanks
|
 |
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
|
|
The one used inside your application. If you don't have one you should create it inside WEB-INF/weblogic.xml same directory as web.xml
[]s
|
 |
sujith delpachithra
Greenhorn
Joined: Oct 14, 2008
Posts: 12
|
|
wow, great.
it works
thanks a lot.
|
 |
kanthu kanumuri
Greenhorn
Joined: Apr 18, 2011
Posts: 1
|
|
Hi,
I have another issue in this area. I am able to download the files, but the file size is zero bytes everytime i download. It is happening for any file extension. Tried .docx,.txt and .zip file.
Can some one please let me know about any additional configuration to resolve this.
-kanthu
|
 |
sujith delpachithra
Greenhorn
Joined: Oct 14, 2008
Posts: 12
|
|
you have to set FILE Content type in http response.
contentType = "image/jpeg";
Google for more ............
|
 |
 |
|
|
subject: Web logic server file direct download
|
|
|