• 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

Download text file

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,
I need to download a text file which is created on the fly to a browser.
My Step
Take some input from the user via html
Query a database
Generate a text file
Send it to the client browser.
Am able to acheive all this. But the out put of this txt file comes on the browser itself whereas my requirements demand that this text file be stored at a user defined location open up the file browser.
Could any let me know how to overcome this situation
Regards
Jack
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jack nick:
Hello there,
I need to download a text file which is created on the fly to a browser.
My Step
Take some input from the user via html
Query a database
Generate a text file
Send it to the client browser.
Am able to acheive all this. But the out put of this txt file comes on the browser itself whereas my requirements demand that this text file be stored at a user defined location open up the file browser.
Could any let me know how to overcome this situation
Regards
Jack


 
Andri G
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[sorry for my previous mistaken reply]
Hi Jack,
In your case, it is opened by the browser because client browsers
usually register for MIME text to be opened by itself (as with some other MIME type - html, images, etc).
So I think you have to change the extension (don't use .txt)
to some type unregister to browsers so default download dialog will show up (maybe ".dat"?).
Hope this may help,
Andri
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The other thing you could do is use jspSmartUpload from http://www.jspsmart.com/ . This will allow you to either download a file or a field from a database.
Jason
 
jack nick
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys will check this out. One think for certain. I did try to send in .dat file instead of a .txt containing plain text but this opens in the browser.
Bye
Jack
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic