This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

copy file from server to client  RSS feed

 
meeraa pillaii
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I want to copy one excel file from server to client using jsp.

Can anybody help me to do this

Regards
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
meeraa pillaii
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Bear Bibeault ,

Thanks a lot for your reply...For example my file is at home directory how can give the path

Regards
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See this JSP FAQ entry. Even though it talks about addressing images and the like, it shows you how to create URLs to any resource in your application.
 
meeraa pillaii
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault
My xls file is in home directory of my server. I gave the path as "http://IPADDR/home/ZSSL_BC.CSV" .But getting the err as 'invalid path' (IPADDR is my ip address) . When tried the full path directly in IE url its not openin that file.Please help me to sort out this.

Also i tried getContextPath() to display the path.But not getting any value...

Regards
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by meeraa pillaii:
Also i tried getContextPath() to display the path.But not getting any value...

That's OK. If the app is in the root context the context path will be blank. Just follow the directions that I sent you to. Do not include the "http://" and domain prefix. Follow the directions.
 
meeraa pillaii
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes my program is at ROOT folder.and i want to open the file at /home folder.

To open a file in ROOT folder i just give /filename

I am not getting idea to open a file at /home folder

(our server is using linux os)

Regards
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you posting under two different accounts and names? if so, please stop. Use one name and one account.

Where is the file in relation to the web app root?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!