Retrieve an image from Cache and save it to another location

StormNet
StormNet used Ask the Experts™
on
Hi all,

I would like to retrieve an image from the Cache and save it to another location on my disk.  I would also like to be able to retrieve some of their attributes like the date and time it was saved to to cache (if possible)

I would really appreciate any help!

Regards
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
Again, more of a Web/HTML question than an MS Access question.

Click the Request Attention link for help assigning the most appropriate zones.

;-)

JeffCoachman

Commented:
I see two aspects to your question:
1) How to determine where the Cache is for Temporary Internet Explorer files, correct?
2) How to determine Save date and time, correct?

For 1, I did a quick check and I'm seeing conflicting information.  I was looking for the registry entry for the location of the IE cache.  In one place, it says it is at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Cache, but on my machine, where I have changed the default to a specific folder, it seems to actually be using the %TEMP% environment variable and adding "Temporary internet Cache" to the end of the env var.  And I have my cache being deleted upon shutdown, so I'd have to test with different settings to see where the files are actually stored.

Additionally, there will be subfolders in which the actual content is stored, and you may have to just traverse the subfolders depending on what you are looking for (all files?  certain files?)

For 2, I'm guessing that you could possibly look at the file properties create date to determine when it was originally saved, but again, I'm seeing conflicting info, possibly because I clear out my cace constently to avoid problems with the cache.

I can try some ideas later tonight, but if you have a chance, maybe you can find something based on those ideas.  

Commented:
OK, I worked out a way to do all of this in VB6, but there is one hitch to doing it in Access.  You are trying to do this in Access, correct?  Just checking, but is that you're only option?  If it is, I need to find a workaround for the one hurdle I ran into.  Let me know.

Commented:
And if it has to be Access, what version of Access?
Commented:
OK, I resolved the issue to create a process in Access 2002 to copy picture files from IE cache.   Attached is a demonstration MDB database that has one form with a list box (rowsource set to value list) that will  list all the picture files from the IE cache in the Listbox.  When you click on one it will copy it to the folder C:\MIS\Access2002\DemoCopyIECache (You should create this folder first.)

You can change the line:
strExtensionsDesired = "jpg,png,gif" 

Open in new window

...to include whatever extensions you need to find.

I referenced sources I used in the code to come up with this solution, with comments where I made changes.
DemoIECache.mdb

Commented:
Oops, I meant that the target location that the files are copied to is "C:\temp\IECacheFileCopy", which you should create first.

Author

Commented:
Hi kbrecki,

Thanks for your input.  I've had a look at the code and I'll be testing out the code this evening when I get home again.

Regards
Shawn

Author

Commented:
It worked very well, Thank you!

Author

Commented:
Hi kbrecki,

Just an update:  I use Access 2003 and for the interest of anyone else these were the actions I took.

Received Error: your microsoft office access database or project contains a missing or broken reference to the file 'owc10.dll' version 1.2
Action: downloaded and installed owc11.dll  (for Access 2003)

Error on compile: FOF_SIMPLEPROGRESS  not defined
Action: added  Const FOF_SIMPLEPROGRESS = &H100&  under option explicit

Once again, thank you very much.  This will make my life a lot easier.

Regards

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial