Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

how to download files to predefined directory at user's local PC?

Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need build something in our java web application to download a zip file from server , and we like to control the directory where the files can be downloaded by our users. What we really like is to save the zip file from server and unzip it to a predefined directory at user's local PC, eg. C:\download.

I like to know what kind of java technology or approach is good to perform such task. On server side, we will create a zip file for each different user. In our jsp page, we will display a message letting user download and save the zip file to a predefined local directory at his/her local disk. But we do not want the user do something like mouse right click and "Save As", since we have no way to control the directory the files are downloaded to.

I know this is a strange requirement to many of you. Just FYI: We are building an offline course player and we like user play a course in offline mode, and we will resynchronize the course tracking data back to server once he/she reconnects to the network. To control the local directory path will make the resynchronizing much easier.

Your input is greatly appreciated.

BTW: This is a web application built only for our company's internal users. So, let us assume there are no security concern as seen in normal web application.
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, Web applications suffer from all sorts of "security" issues. Even when you are writing for clients in your own company, you still fall foul of features (and non-features) that are in Web browsers to protect against bad guys.

If the client side of your application is in JavaScript, I believe you cannot do arbitrary file operations like you want. The Web browser very definitely does not want Web applications doing stuff to the local file system, outside the control of the user.

If your client side were an applet, and you managed to get sufficient privileges given to the applet, then maybe...
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic