• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Web logic server file direct download

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wow, great.
it works

thanks a lot.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you have to set FILE Content type in http response.

contentType = "image/jpeg";

Google for more ............
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic