Link to home
Start Free TrialLog in
Avatar of SHAHEEN_AKHTAR
SHAHEEN_AKHTARFlag for India

asked on

Download and Save files to Temporary Internet Files folder

Hi Delphi Experts,
I have made a delphi tool bar for IE using Delphi Band project code. I want to display some news scrolling in a label. Scrolling part I could complete. Now my question is:
The News comes from RSS feed. I have to extract all titles and pass them to the Label Caption property.
I want to know how to download the rss feed and save to Temporary Internet Files folder on client machine (who placed my tool bar). Temporary Internet Files folder location cannot be hard coded as C:\........\......\....... etc. Can some one help me please.
Regards
ASKER CERTIFIED SOLUTION
Avatar of SteveBay
SteveBay
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SHAHEEN_AKHTAR

ASKER

Thanks both of you experts. I will implement today and come back. cheers.
Both the codes I used and I got the folder names but when I try to save xml file using XmlDocument.SaveToFile(FilePath) I get access denied. Any tip please.

Thanks
Sound like a Windows rights issue. To test this, try to create a text file in that folder using Windows Explorer. If you cannot, then you must increase the user's rights to allow file create in that folder or choose a folder where the user has appropriate rights.
Yes you are right. I am developing an IE tool bar it is complete minus this issue. If my client installs this tool bar, I have to programmatically set the write permissions, which I hope not possible for special folders. I wanted to achieve the functionality like IE stores files in temporary internet files whenever it is navigates to a URL.
I will test it with
IE:Iwebbrowser2;
IE.visible := False;
IE.Navigate('url of the xml file');

Before that any solution comes in, kindly post it.

Thanks a lot
Are you testing this on Vista by chance? You should have permissions to this folder UNLESS you are running on Vista, which treats this as a protected folder. My recommendation would be to set up your own folder eg, under GetFolderPath(CSIDL_APPDATA) + '\YourApplication'

which would be:

"C:\Documents and Settings\{YourUserAccount}\Application Data\YourApplication"

This way, you will have control over the folder (and files) and not have to worry about the OS inconsistiencies.

Russell
I am trying on XP SP2.