• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dwonloading issue

 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a problem during downloading a file from database.
I first upload file under file name and using uploadinterceptor.
Now when I downloading, I create a .jsp page which list files in database, providing link to each of them to download.
When user choose file, request goes to action (let say action with name -Download)
that action further process to servlet, which read from database file and output it:



The problem is that, file offered to download has name - Download.action - ! Not the real name what it was uploaded under , just name of action followed .action suffix.
What goes wrong, and how can I improve this code?!
Thanks in advance
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't really Struts-related and might be better-asked on a servlet-oriented forum.

You have to set the content disposition/etc. to get a different filename; searching the web for file download will find many examples.
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But how can I avoid that in my address bar to stay action name with suffix, like Download.action, and not a page which that action return as a result like - download_form.jsp-
just as it name of page supplied as a result page?
 
Goran Markovic
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
found solution. thanks anyway...
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When solutions are found it's nice to include them in the thread so that in the future people asking the same question might also find the answer.

Thanks!
reply
    Bookmark Topic Watch Topic
  • New Topic