• Post Reply Bookmark Topic Watch Topic
  • New Topic

uploaded file not opening in href

 
neha kothari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

my code uploads a file to server.it works perfectly. however when i try to access it through href it says file not available.but the file is present.

also,if i make any changes to the file like renaming tit etc the link works. kindly help

my code is



my file upload code is

 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure your href is correct? Is your file deployed in the server?
 
Tim Holloway
Bartender
Posts: 18414
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. You should NEVER attempt to upload files into a WAR. Even when it works, it's dangerous. Always upload to an independent data directory external to the webapp and the webapp server.

2. You're putting executable Java code in a JSP. Expect to be chastised shortly.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see this so often still that I get tired of being the broken record, but because Tim brought it up: consider yourself chastised. Java scriptlets have been obsolete for 13 years. 13 years! Any use of them now in a JSP is simply irresponsible and a sign that one is not serious about web development as a craft.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:1. You should NEVER attempt to upload files into a WAR.


And yes, quoted for truth. That's just asking for a world of hurt.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!