Go Premium for a chance to win a PS4. Enter to Win


How send multiple files to clients computer?

Posted on 1998-09-06
Medium Priority
Last Modified: 2012-05-04
Using FrontPage98, Access, and ASP.
Prefer answer in VBScript..if not possible then something

This is about delivering image-files over Internet.
The client have selected one or more images to download to his own computer (from the webserver).

When the client hit the submit-button in the ORDER-form, I
want that ALL the selected images shall be sent to one specific directory on the client's computer.
The images that the client ordered are stored in a commaseparated session-variable (with all the unique image-ID's). So when the Client hit the submit-button I want to activate code in an ASP-page, find all the related records in the Access DB, get the image-path for each Image, and
send each Image-file to the directory on the client's computer. The files must be sent one by one. And I have to be sure that each file did reach the destination.

This seems to be a lot....but...
I only want the syntax of the code that get the downloading
of the files done, and eventually the error-handling code.
IMPORTANT...The user shall only click once to start downloading of all the files.

Depending of the work ..this question might be upgraded to
more points. Good luck.

Question by:erot
  • 9
  • 3
  • 2
  • +2
LVL 28

Expert Comment

ID: 1837377
If you send an image to a browser, and you use gif or jpg, the images will not be downloaded to a directory, but will be displayed in the browser (and stored in the browser's cache).

If you want the selected images to be downloaded in one run, I guess your best best is to create on the fly a zip file with the selected images and send that zip file.

In fact you are dealing with 2 things:
1. a server-side problem of sending the selected images, which is not so hard to solve, especially because you control the server and can install what you want on the server.
2. a client-side problem of receiving and storing the images. This is much harder to solve, because you don't have access to the client's computer.

I suggest that you treat those problems seperately, because they each need a different approach. It is imaginable that you will end up using java or ActiveX at the client side, or make use of another protocol then the HTTP (maybe FTP).

LVL 10

Expert Comment

ID: 1837378
There is a server side component called ServerZip from Stonebroom Computers that will take the selections of a user, zip them into one zip file nad then send the images..  You can get a trial version from www.stonebroom.com or from www.wrox.com (look for the book Professional Active Server Pages 2.0 --> example code).

This looks like your best alternative.


Author Comment

ID: 1837379
The files that shall be downloaded are already compressed.
I MUST send the files ONE by ONE, and be able to check if the
files did download or not.
The files shall not be viewed in the client browser, but shall
be saved directly into a folder on the client computer.
The client shall choose which directory to download to, so
there will be no need to create new directories.
The ServerZIP are not available any more...from WROX...but can it solve the above problem.

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 1837380
The ServerZip is not available anymore due to a bug/problem. !

Is there any other way to solve the problem....and please read
my previous comment regarding my question.


Author Comment

ID: 1837381
Comment to Sybe's answer...
  Do you have any example code for pnt 1 and 2 in your answer?


Author Comment

ID: 1837382
To sybe: Same as above...???!???!?!?!?!?
LVL 28

Expert Comment

ID: 1837383
Ok, but first reject MasseyM's answer, and reopen the question.

Author Comment

ID: 1837384
The solution/object (serverZip) is not available any more.

Expert Comment

ID: 1837385
I didn't catch if you wanted pre-made packages of pictures, or that the users select a number of pictures.. in any case, what you need is a page that does this :

<meta http-equiv="refresh" content="0; url=http://yoursite.foo/file.zip>

You need one for each file, ofcourse. This will cause sensible browser to start downloading it.
One more thing you should do is to have the browser open another window for that.. it's called window.open, but I don't remember the syntax. anyway, the rest should be easy.. :)

Author Comment

ID: 1837386

Author Comment

ID: 1837387
To buzh...Sorry about the last comment!!! When I logged in
I did only see a comment from you telling "Text above", which
did'nt make any sense.
When I looked over the history I saw something quite different
answer from you....but do you have any example code, and
when the user starts the downloading he only clicks a submit-button. I want the code on the server to send the image-files, one by one and verifying each download (did the file actually download or not).



Expert Comment

ID: 1837388
Well.. what you need is an asp/cgi/java/whateveryouprefer app that does it server-side. I'm not able to test any code I may produce right now, but what you need to do is this :
- make a <form> that has the user select what files to get.
then you need a script that..
- grabs the options of the form. (they're sent as paramters like this, ?name=value after whatever you put in <form action=
- generates html. this isn't as hard as it sounds.
- the html must open a separate browser window with the window.open function and the code I mentioned earlier

That should solve it. Sorry there's no more specific code, tho.

Author Comment

ID: 1837389
comments to buzh.
  As mentioned earlier I do not want to send any information
  about what files to download to the client machine. Which means
  I want it to work like this:
  a) the user click the submit-button.
  b) the submit-button is connected to an ASP-page with the
     'POST' option.
  c) the code in the ASP-page will know from a server-variable
     what images the client shall download.
     The code scans through an Access table (ODBC) and get
     each image's full path on the server.
  d) start to download an image to the client's machine. This
     could be on the following folder on the client: 'C:\temp'.
  e) check if the download went OK. If it did repeat point d) and
     e) untill there are no more images to download.

  What I'm interested in is how to solve point d) and e).
  Is this possible??? ...and if ...example code please.
  (is it possible to start the download process from the server?)

If there is example code to come...the points will be upgraded...


Expert Comment

ID: 1837390
No, you cannot do this..
The only thing you can do is generate html to have the client do things automagically, like the http-equiv thing I mentioned. You cannot tell the client to do anything, it has to do it by itself.
What I suggest you do to solve problem d and e, is :
- Generate a list of the files to be sent and use the window.open/http-equiv to have the client download the file.
- Have a few buttons on the page that say "Did the file come through correctly? (y/n)".
- If the user presses yes, generate a page with the next filename. If no, redo from start.

This will ensure that the user gets the files. Also, you could make a system that enables the client to get the files (even multiple times) over a weeks time, so that you can be sure that the user gets what he pays(?) for.


Accepted Solution

neinei earned 270 total points
ID: 1837391
Hmmm your question is very chalanging. But I try to solve the problems. Well, To download multiple file there are two choice :
1. All files will be downloaded
   You can save the file name in the Access database.
   When the client clicks Submit button, the cursor of the table can be moved (RS.MoveNext), and everyfiles can be downloaded
2. Some Files will be downloaded
   You have to show the files from database and attach the checkbox. When the client clicks Submit button, the proper files will be downloaded.

And about checking the downloaded files, you can generate JavaScript (not JScript) that running on the client computer, checking the filename and size, every one of the downloaded files is downloaded. The JavaScript must show the button that indicating all files have been downloaded, and the client must click the button. The button has an event that is going to send a message to the server e-mail.

Wish you luck!!!

Author Comment

ID: 1837392
To NeiNei: Thank you for your answer...
   Can you provide me with some example code for point one
   and the JavaScript.
   Please let me know if you need more points and eventually
   how many.

   Erot. (sorry that this took some time have been on a vacation)

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question