Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Help Saving files using Javascript


Message #1 by "Chip Dukes" <cdukes77@b...> on Sat, 23 Feb 2002 17:28:57 -0500
I have some code at work which accepts a URL and saves it to a hard drive.
Needless to say it will generate an ActiveX warning if used in a web page.
It makes use of two classes, one which comes with MDAC 2.5 and one with
MSXML parser, both are freely available from Microsoft and are standard
components on most modern Windows set-ups.
I will send you the full code tomorrow if you wish but in the mean time here
is the technique:
Use MSXML2.XMLHTTP to open a synchronous 'GET' request to the URL of the
file to save.
Open an ADODB.Stream and write the data received in first step to the
stream.
Use the SaveToFile method of the Stream to save the file to HD.

I've posted this code before in newsgroups so a search on Google groups will
find it if you're desperate.

Joe


----- Original Message -----
From: "Chip Dukes" <cdukes77@b...>
To: "javascript" <javascript@p...>
Sent: Saturday, February 23, 2002 10:28 PM
Subject: [javascript] Help Saving files using Javascript


I need to extract a series of more than 3000 images from an Access database
(since I cannot export them directly from the database I will use an ASP
page to load the picture(s) into a standard HTML document) ...

What I need is a bit of Javascript that will automatically save the image to
my HD from the HTML page ...

Can anyone give me a jump start. If this is impossible ... post a note so I
can look for other solutions.

Chip





  Return to Index