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

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

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
On top of spaghetti all covered in cheese, there was this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic