Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download files automatically from a web page (VFP8/XP)

Status
Not open for further replies.

foxbldr

Programmer
Apr 16, 2002
109
CA
I want to download files (TIF/FAX) from a site without any user interaction.

(At the moment, user opens the page, points to the link, then "Save Target As" for each and every file.)

I have posted some HTML codes below and what user wants to download are report1.fax, report2.fax and report3.fax files.

Code:
<a href="viewattachment.jsp?id=94316&name=2005-04-22+report1.fax" target="_blank" >2005-04-22 Report </a>&nbsp;

<a href="viewattachment.jsp? name=report2.fax="_blank" >report3.fax</a>&nbsp;


Any help will be greatly appreciated.

Foxbldr
 
Foxbldr

Are you wanting to do this through VFP? (It's not mentioned)

If yes, try this:
We used it for an app and it works!

I wont go into all the extras it offers, so take a look at the link.

If it does help, the only thing I would say is that in the early stages we had a few teething problems with the code, but once ironed out, it works very effectively.

Good luck
Lee

Visual FoxPro Versions: 6 & 9
Operating System: Windows XP
 
foxbldr,

You'll need to scrape the page for the targets and place them in a string. Then you can use the following FAQ code to download the file and provide the user a nice feedback interface with little to no work on your part...

Add Download Ability to Your App in 2 Seconds faq184-3838

boyd.gif

 
Lee/Craig

Thank you for replies.

Let me be little bit descriptive about my problem.

Our user accesses a web based emails and each email comes with several attachments(.TIF,.FAX,.PDF..etc). Currently, user clicks on attachments and choose "Save as/Save Target as" option from browser to download them. We are trying to eliminate user interaction here.


We managed to read all links into and array and used "Navigate2" method of browser object to download them. But, Download File dialog box appears and wait for user action.

Thanks

Foxbldr





 
Once you have all the links, it's easy... see faq184-3019 for how to simple call ReadUrl( tcUrl ) to download an entire file from any url (the file can be anything served up the the webserver, though the faq often calls it a "web page")

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top