Is there away to do so?
Does htmlimg object contain the binary data of the image somewhere?
I can use URLdownloadtofile API but that means I am bypassing internetexplorer proxy
I want to download file through internet explorer
Printable View
Is there away to do so?
Does htmlimg object contain the binary data of the image somewhere?
I can use URLdownloadtofile API but that means I am bypassing internetexplorer proxy
I want to download file through internet explorer
If it's showing in the browser, then it's already downloaded to your computer. IE saves images and stuff to a temporary/cache folder. You may have to figure out the path it saves to and copy it to another folder.
Okay. I have to figure out the path and copy it to another folder. The question is how?
Anyone knows? I need ways that work both for vb6 and vb.net
C:\Documents and Settings\WINDOWS_USERNAME\Local Settings\Temporary Internet Files
That's the folder for me. I went to Google and then opened that folder and saw the logo.gif file. The name of the file is the same as it appears in the webpage. I'm pretty sure it's just a shortcut, though.
Maybe someone else knows more about this, I don't really have the time at the moment to try.
Interesting. The name of the file is the same with the name of the appearingin webpage.
Is there a way to know the location of C:\Documents and Settings\WINDOWS_USERNAME\Local Settings\Temporary Internet Files automatically or programatically?
This seems to be a good enough solution.
I would use SHGetSpecialFolderLocation
I found this, only skimmed through it quickly. It might have what you need:
http://www.vbforums.com/showthread.php?t=99951
Just so you know, when you use the URLDownloadToFile API, if the file exists it will copy that file from the cache for you and not use more bandwidth (or so it seems to me when I use it in conjunction with the webbrowser control). Give it a test...
Good Luck
So if the file exist it'll get that from internet explorer cache and if it doesn't it'll download?
Actually I do use urldownloadtofile API. The cache is definetely there but the download just fail. The download doesn't fail if IE do not use proxy.
I think urldownloadtofile does use a cahce, but it's a different cache than the one internet explorer use.
Can anyone confirm this?
Let me check.
it is also possible to copy and paste images from the webbrowser itself, there was a thread on that recently
Oh really.
That would be the best way. How? I've been looking for it.
see this thread
http://www.vbforums.com/showthread.p...ges+webbrowser
Okay, I used SHGetSpecialFolderLocation. I manage to get the name of the file.
However, it seems that it's not a regular file. If I double click it will open firefox rather than regular image.
Also fileExist(theFile) where
Public Function fileExist(filename As String) As Boolean
Dim fso As FileSystemObject
Set fso = New FileSystemObject
fileExist = fso.FileExists(filename)
End Function
will produce false.
so the file is C:\Documents and Settings\Ferry\Local Settings\Temporary Internet Files\thefile.jpg which is correct. But it'll produce false as if there is no such file.
Hmm.... Any other alternative?