469,929 Members | 1,790 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

downloading files with IE built-in method...

Handling file downloading with Randy Birch very nice code
(http://vbnet.mvps.org/code/internet/...ledownload.htm)
raises a second question:

I my case, the user should not be allowed to change the save destination for
the downloaded file. Does anyone know if it is possible to circumvent the
save dialogbox, for example by hiding it, or by auto-clicking the save
command button on the dialogbox closing the box with the destination path
without user intervention?

Cheers, Soeren
Jul 17 '05 #1
3 3584
Private Declare Function URLDownloadToFile Lib "urlmon" Alias
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal
szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As
Long
Public Function DownloadFile(URL As String, LocalFilename As String) As
Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
'example by Matthew Gates (Pu*****@hotmail.com)
DownloadFile "http://www.allapi.net", "c:\allapi.htm"
End Sub

S.W. Rasmussen heeft geschreven in bericht
<40*********************@dread11.news.tele.dk>.. .
Handling file downloading with Randy Birch very nice code
(http://vbnet.mvps.org/code/internet/...ledownload.htm)
raises a second question:

I my case, the user should not be allowed to change the save destination forthe downloaded file. Does anyone know if it is possible to circumvent the
save dialogbox, for example by hiding it, or by auto-clicking the save
command button on the dialogbox closing the box with the destination path
without user intervention?

Cheers, Soeren

Jul 17 '05 #2
But he want's an interface.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Slaatje" <So******@mail.com> wrote in message
news:c6**********@reader08.wxs.nl...
: Private Declare Function URLDownloadToFile Lib "urlmon" Alias
: "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal
: szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As
: Long
: Public Function DownloadFile(URL As String, LocalFilename As String) As
: Boolean
: Dim lngRetVal As Long
: lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
: If lngRetVal = 0 Then DownloadFile = True
: End Function
: Private Sub Form_Load()
: 'example by Matthew Gates (Pu*****@hotmail.com)
: DownloadFile "http://www.allapi.net", "c:\allapi.htm"
: End Sub
:
:
:
: S.W. Rasmussen heeft geschreven in bericht
: <40*********************@dread11.news.tele.dk>.. .
: >Handling file downloading with Randy Birch very nice code
: >(http://vbnet.mvps.org/code/internet/...ledownload.htm)
: >raises a second question:
: >
: >I my case, the user should not be allowed to change the save destination
: for
: >the downloaded file. Does anyone know if it is possible to circumvent the
: >save dialogbox, for example by hiding it, or by auto-clicking the save
: >command button on the dialogbox closing the box with the destination path
: >without user intervention?
: >
: >Cheers, Soeren
: >
: >
:
:

Jul 17 '05 #3
Perhaps I should be a bit more specific: Randy Birch suggestion (code to be
found at: http://vbnet.mvps.org/code/internet/...ledownload.htm) works
absolutely fine displaying a progressbar and downloading details. My
question was if it is possible to prevent the user from changing the
download save destination by hiding or auto-closing the save-dialogbox
before the user has a change to change it.

Cheers, Soeren

"Randy Birch" <rg************@mvps.org> wrote in message
news:7e********************@twister01.bloor.is.net .cable.rogers.com...
But he want's an interface.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Slaatje" <So******@mail.com> wrote in message
news:c6**********@reader08.wxs.nl...
: Private Declare Function URLDownloadToFile Lib "urlmon" Alias
: "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal : szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As
: Long
: Public Function DownloadFile(URL As String, LocalFilename As String) As
: Boolean
: Dim lngRetVal As Long
: lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
: If lngRetVal = 0 Then DownloadFile = True
: End Function
: Private Sub Form_Load()
: 'example by Matthew Gates (Pu*****@hotmail.com)
: DownloadFile "http://www.allapi.net", "c:\allapi.htm"
: End Sub
:
:
:
: S.W. Rasmussen heeft geschreven in bericht
: <40*********************@dread11.news.tele.dk>.. .
: >Handling file downloading with Randy Birch very nice code
: >(http://vbnet.mvps.org/code/internet/...ledownload.htm)
: >raises a second question:
: >
: >I my case, the user should not be allowed to change the save destination : for
: >the downloaded file. Does anyone know if it is possible to circumvent the : >save dialogbox, for example by hiding it, or by auto-clicking the save
: >command button on the dialogbox closing the box with the destination path : >without user intervention?
: >
: >Cheers, Soeren
: >
: >
:
:

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bala | last post: by
reply views Thread by just.starting | last post: by
10 posts views Thread by mwt | last post: by
1 post views Thread by tshad | last post: by
8 posts views Thread by danish | last post: by
1 post views Thread by Bryan729 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.