Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Direct file download

Reply
 
Old 10-28-2008   #1 (permalink)
raymond_b_jimenez


 
 

Direct file download

I need to download a file from an Intranet web site and feed it into a
program on the PC where the browser is running. Browser is Internet
Explorer. Both Javascript and VBscript are options.
Which would be my best options? Examples would be welcomed!
rj

My System SpecsSystem Spec
Old 10-28-2008   #2 (permalink)
David Mark


 
 

Re: Direct file download

On Oct 28, 5:28*pm, raymond_b_jime...@xxxxxx wrote:
Quote:

> I need to download a file from an Intranet web site and feed it into a
> program on the PC where the browser is running. Browser is Internet
That's one of the things that browsers do.
Quote:

> Explorer. Both Javascript and VBscript are options.
IE can do it as it is a browser. Script is not required.
Quote:

> Which would be my best options? Examples would be welcomed!
> rj
Push out a blob of registry entries to associate the file type with
the program, map the appropriate MIME type to the file type, adjust
security settings, etc. These are tasks for your Intranet
administrator.
My System SpecsSystem Spec
Old 10-29-2008   #3 (permalink)
Tom Lavedas


 
 

Re: Direct file download

On Oct 28, 5:28*pm, raymond_b_jime...@xxxxxx wrote:
Quote:

> I need to download a file from an Intranet web site and feed it into a
> program on the PC where the browser is running. Browser is Internet
> Explorer. Both Javascript and VBscript are options.
> Which would be my best options? Examples would be welcomed!
> rj
Maybe this will help (doesn't need browser):

http://groups.google.com/group/micro...20d6c8e247f1fa

Once the file is available on the local machine, use the Wscript.Shell
in your script to start the application referencing the local file ...

sDownLoadedFile = "d:\somewhere\filename
with CreateObject("Wscript.Shell")
.Run "d:\location\your_application.exe " & sDownLoadedFile , 0, True
end

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
My System SpecsSystem Spec
Old 10-29-2008   #4 (permalink)
raymond_b_jimenez


 
 

Re: Direct file download

Thanks Tom. I had seen the code, I tested it again, but it doesn't
work. It won't execute
With CreateObject("ADODB.Stream")
Seems like the example is server side code, but I need it to run on
the client. Can you confirm the code sample can be executed in
VBScript on the client browser?
rj

On Oct 29, 2:12*pm, Tom Lavedas <tglba...@xxxxxx> wrote:
Quote:

> On Oct 28, 5:28*pm, raymond_b_jime...@xxxxxx wrote:
>
Quote:

> > I need to download a file from an Intranet web site and feed it into a
> > program on the PC where the browser is running. Browser is Internet
> > Explorer. Both Javascript and VBscript are options.
> > Which would be my best options? Examples would be welcomed!
> > rj
>
> Maybe this will help (doesn't need browser):
>
> http://groups.google.com/group/micro...ng.vbscript/ms...
>
> Once the file is available on the local machine, use the Wscript.Shell
> in your script to start the application referencing the local file ...
>
> sDownLoadedFile = "d:\somewhere\filename
> with CreateObject("Wscript.Shell")
> * .Run "d:\location\your_application.exe " & sDownLoadedFile , 0, True
> end
>
> Tom Lavedas
> ===========http://members.cox.net/tglbatch/wsh/
My System SpecsSystem Spec
Old 10-29-2008   #5 (permalink)
raymond_b_jimenez


 
 

Re: Direct file download

Thanks David,
The idea is that the user only clicks once and generates the whole
process. I cannot associate the file type because they are doc files,
and they have to be openable by Word in Windows. The idea is to pass
them through another application. My main problem is downloading the
file to a special directory (temp directory) without the user having
to select it.
rj

On Oct 28, 9:38*pm, David Mark <dmark.cins...@xxxxxx> wrote:
Quote:

> On Oct 28, 5:28*pm, raymond_b_jime...@xxxxxx wrote:
>
Quote:

> > I need to download a file from an Intranet web site and feed it into a
> > program on the PC where the browser is running. Browser is Internet
>
> That's one of the things that browsers do.
>
Quote:

> > Explorer. Both Javascript and VBscript are options.
>
> IE can do it as it is a browser. *Script is not required.
>
Quote:

> > Which would be my best options? Examples would be welcomed!
> > rj
>
> Push out a blob of registry entries to associate the file type with
> the program, map the appropriate MIME type to the file type, adjust
> security settings, etc. *These are tasks for your Intranet
> administrator.
My System SpecsSystem Spec
Old 10-29-2008   #6 (permalink)
Tom Lavedas


 
 

Re: Direct file download

On Oct 29, 11:42*am, raymond_b_jime...@xxxxxx wrote:
Quote:

> Thanks Tom. I had seen the code, I tested it again, but it doesn't
> work. It won't execute
> * * With CreateObject("ADODB.Stream")
> Seems like the example is server side code, but I need it to run on
> the client. Can you confirm the code sample can be executed in
> VBScript on the client browser?
> rj
>
> On Oct 29, 2:12*pm, Tom Lavedas <tglba...@xxxxxx> wrote:
>
Quote:

> > On Oct 28, 5:28*pm, raymond_b_jime...@xxxxxx wrote:
>
Quote:
Quote:

> > > I need to download a file from an Intranet web site and feed it into a
> > > program on the PC where the browser is running. Browser is Internet
> > > Explorer. Both Javascript and VBscript are options.
> > > Which would be my best options? Examples would be welcomed!
> > > rj
>
Quote:

> > Maybe this will help (doesn't need browser):
>>
Quote:

> > Once the file is available on the local machine, use the Wscript.Shell
> > in your script to start the application referencing the local file ...
>
Quote:

> > sDownLoadedFile = "d:\somewhere\filename
> > with CreateObject("Wscript.Shell")
> > * .Run "d:\location\your_application.exe " & sDownLoadedFile , 0, True
> > end
>
Quote:

> > Tom Lavedas
> > ===========
> > http://members.cox.net/tglbatch/wsh/
I didn't understand you original post to mean it was for client side
script. None of the ActiveX controls invoked in my examples will work
in client side scripting without significant security intervention/
risk. In fact, executing an application on a user's machine is
strictly verboten in an Inter/Intranet environment.

The only way I know to come close is to get the client to download an
HTA (Hypertext Application) and then use it to access the file and run
the application. In its simplest incarnation, an HTA is an HTML with
its extension changed to .hta. When run by the user on his local
machine, it can access all of the IE controls, but the security
environment is far less stringent. It can run ActiveX controls, such
as the MSXML, ADODB and Wscript Shell.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

My System SpecsSystem Spec
Old 10-29-2008   #7 (permalink)
David Mark


 
 

Re: Direct file download

On Oct 29, 11:44*am, raymond_b_jime...@xxxxxx wrote:
Quote:

> Thanks David,
> The idea is that the user only clicks once and generates the whole
> process. I cannot associate the file type because they are doc files,
> and they have to be openable by Word in Windows. The idea is to pass
> them through another application. My main problem is downloading the
> file to a special directory (temp directory) without the user having
> to select it.
The browser does that for you. Give the ones on the server a
different extension. Your client side program can rename them to
DOC's when it is done processing them. Then the users can open them
in Word.
My System SpecsSystem Spec
Old 11-22-2008   #8 (permalink)
Si Ballenger


 
 

Re: Direct file download

On Tue, 28 Oct 2008 14:28:19 -0700 (PDT),
raymond_b_jimenez@xxxxxx wrote:
Quote:

>I need to download a file from an Intranet web site and feed it into a
>program on the PC where the browser is running. Browser is Internet
>Explorer. Both Javascript and VBscript are options.
>Which would be my best options? Examples would be welcomed!
>rj
I use the below as a download shell for a webcam security and
weather program.

Set objArgs = WScript.Arguments
url = objArgs(0)
pix = objArgs(1)
With CreateObject("MSXML2.XMLHTTP")
.open "GET", url, False
.send
a = .ResponseBody
End With
With CreateObject("ADODB.Stream")
.Type = 1 'adTypeBinary
.Mode = 3 'adModeReadWrite
.Open
.Write a
.SaveToFile pix, 2 'adSaveCreateOverwrite
.Close
End With

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Is it possible to provide a direct download link to file in Windows Live Space? Live Mail
direct link to download WLM Live Messenger
Direct X 10 download.. Vista General
DIRECT download link for WLM 12.0.1606? Live Mail
Direct download links Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46