Advertisement

04.15.2008 at 09:38PM PDT, ID: 23325996
[x]
Attachment Details

Download file attachment to local file system

Asked by popbalu in Web Languages/Standards, Scripting Languages, VB Script

Tags: IBM, Lotus Notes, 6.5, VBScript, IE 7

Hi All,

I used the ExtractFile user defined function using VBScript, that i got from an internet source.
While downloading word document file, it consumes more time. Is there any alternate solution for this?
Please suggest me any idea.

Thanks for your help Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
Sub ExtractFile(url,folder)
 
	TEMPPATH = folder & "\"
	Rem Parses the filename from the url
	outputfile = TEMPPATH & Mid(url, InStrRev(url, "/") + 1)
 
	Const ForReading = 1, ForWriting = 2, ForAppending = 8
	Set fsoMain = CreateObject("Scripting.FileSystemObject")
	Set objHTTP = CreateObject("Microsoft.XMLHTTP")
	Set fsResults = fsoMain.OpenTextFile(outputfile, ForWriting, True)
	Call objHTTP.Open("GET", url, False)
	objHTTP.Send
	Dim i
 
	REM Write the file byte by byte
	For i = 1 To LenB(objHTTP.ResponseBody)
	fsResults.Write Chr(AscB(MidB(objHTTP.ResponseBody, i, 1)))		
	Next
	Set fsoMain=Nothing
	Set objHTTP=Nothing
	Set fsResults=Nothing
 
End Sub
[+][-]04.15.2008 at 11:27PM PDT, ID: 21365200

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 11:29PM PDT, ID: 21365210

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Web Languages/Standards, Scripting Languages, VB Script
Tags: IBM, Lotus Notes, 6.5, VBScript, IE 7
Sign Up Now!
Solution Provided By: Frosty555
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628