• 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

Java Script reading client responses

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I've been using Colf Fusion to set up an automated email response after downloading evaluation software from our company site but unfortunatly there doesn't seem to be a way using cold fusion to tell whether the client has downloaded the file or pressed cancel on the save file dialog. Someone suggested I have a look at JavaScript. Would anyone know where I can find a good tutorial that deals with Http requests responses in JavaScript or where i could find some sample code?
Cheers
Will Reilly
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
William
I'm moving this to the HTML and Javascript page. You'll get more responses there.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't see a Javascript solution since the Javascript runs in a page and the file being downloaded isn't 'inside' the page. I can't see the Javascript having any control over the download process. I may well be wrong though
I'd look at a Servlet solution, where the client requests the file to be downloaded from a Servlet rather than requesting the file itself. This allows the Servlet to 'watch' the streams.
If the client cancels the download before it is completed or something else goes wrong, an Exception should be automatically thrown which the Servlet can detect and manage as a 'failed' download situation.
Dave.
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I agree that server side solution is much better,but if you still interested to make it working with Javascript, I suggest you to look: for IE 5 and up at behaviors (there is one called downloader), or ActiveX component Scripting.FileSystemObject; for NS you could use LiveConnect - just directly use Java classes in your script.
 
reply
    Bookmark Topic Watch Topic
  • New Topic