Edmonds Commerce Logo
  • home
    • blog
  • ecommerce
    • product catalogue
    • order processing
    • customer services
    • stock control
    • human resources
    • management information
  • development
    • oscommerce
    • php
    • mysql
    • open source
    • performance tuning
  • design
  • marketing
  • contact us
    • pricing

Edmonds Commerce Blog

Freelance PHP Ecommerce and SEO Developer in the UK

Latest Posts

Securing a LAMP Server with mod_security
osCommerce Easypopulate File Creator Class
CRELoaded Remove Google Ads -
ICECat Integration with osCommerce, Magento etc

Most Popular Posts

PHP Email Attachment Function Freelance osCommerce UK Ultimate osCommerce Checkout - Fast and Friendly PHP : Dead Easy Excel Export

Saving a File or Webpage using PHP

February 28th, 2008
Read More php

Sometimes you want your PHP script to grab a text file or other external resource and save it locally.

Here is my simple function for doing just that.

PLAIN TEXT
PHP:
  1. function save_external_resource($resource, $filename){
  2. $data = fopen($resource, 'r');
  3. file_put_contents($filename, $data);
  4. }

You can save any kind of resource from anywhere on the web that you have access to and save it locally.

For large files you may need to edit your php.ini and increase the resource limits and max execution time.

Bookmark this Post
Add 'Saving a File or Webpage using PHP' to Del.icio.usAdd 'Saving a File or Webpage using PHP' to diggAdd 'Saving a File or Webpage using PHP' to FURLAdd 'Saving a File or Webpage using PHP' to blinklistAdd 'Saving a File or Webpage using PHP' to redditAdd 'Saving a File or Webpage using PHP' to Feed Me LinksAdd 'Saving a File or Webpage using PHP' to TechnoratiAdd 'Saving a File or Webpage using PHP' to Yahoo My WebAdd 'Saving a File or Webpage using PHP' to NewsvineAdd 'Saving a File or Webpage using PHP' to SocializerAdd 'Saving a File or Webpage using PHP' to Ma.gnoliaAdd 'Saving a File or Webpage using PHP' to Stumble UponAdd 'Saving a File or Webpage using PHP' to Google BookmarksAdd 'Saving a File or Webpage using PHP' to RawSugarAdd 'Saving a File or Webpage using PHP' to SquidooAdd 'Saving a File or Webpage using PHP' to SpurlAdd 'Saving a File or Webpage using PHP' to BlinkBitsAdd 'Saving a File or Webpage using PHP' to NetvouzAdd 'Saving a File or Webpage using PHP' to RojoAdd 'Saving a File or Webpage using PHP' to BlogmarksAdd 'Saving a File or Webpage using PHP' to ShadowsAdd 'Saving a File or Webpage using PHP' to Co.mments
Add 'Saving a File or Webpage using PHP' to ScuttleAdd 'Saving a File or Webpage using PHP' to BloglinesAdd 'Saving a File or Webpage using PHP' to TailrankAdd 'Saving a File or Webpage using PHP' to SegnaloAdd 'Saving a File or Webpage using PHP' to OKnotizieAdd 'Saving a File or Webpage using PHP' to NetscapeAdd 'Saving a File or Webpage using PHP' to Bookmark.itAdd 'Saving a File or Webpage using PHP' to AskAdd 'Saving a File or Webpage using PHP' to SmarkingAdd 'Saving a File or Webpage using PHP' to LinkagogoAdd 'Saving a File or Webpage using PHP' to DeliriousAdd 'Saving a File or Webpage using PHP' to SocialdustAdd 'Saving a File or Webpage using PHP' to Live-MSNAdd 'Saving a File or Webpage using PHP' to SlashDotAdd 'Saving a File or Webpage using PHP' to SphinnAdd 'Saving a File or Webpage using PHP' to DiggitaAdd 'Saving a File or Webpage using PHP' to SeotribuAdd 'Saving a File or Webpage using PHP' to FaceBookAdd 'Saving a File or Webpage using PHP' to UpnewsAdd 'Saving a File or Webpage using PHP' to WikioAdd 'Saving a File or Webpage using PHP' to Social Bookmarking Reloaded

Feed | Respond | Trackback

Leave a Reply

  • RSS Feed
  • Categories

    • apache
    • barcode
    • creloaded
    • curl
    • customer services
    • debugging
    • ecommerce
    • email
    • excel
    • firefox
    • flash
    • gd
    • graphs
    • hosting
    • icecat
    • internet news
    • javascript
    • link building
    • linux
    • magento
    • management
    • mod_rewrite
    • mysql
    • oscommerce
    • php
    • plesk
    • product catalogue
    • product feed
    • programming
    • regular expressions
    • scraping
    • search engine optimisation
    • security
    • spidering
    • ubuntu
    • web design
    • web development
    • Windows
    • xampp
    • zip
  • Archives

    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
  • Tags

    addons advanced adverts blackhat blocking css curl development directories find firefox google hosts file html javascript keywords links msn mysql myths operators oscommerce paid links paid placement performance php ppc reciprocal linking replace screen scraping security seo serp speed spider spidering tuning user friendly vista web web design web developer
  • Random Posts

    • Web Developer Toolbar for Firefox
    • osCommerce Essential Modifications
    • Apache, mod_rewrite and SEO
    • Favourite Firefox Extensions
    • PHP, cURL, CURLOPT FOLLOWLOCATION and open basedir Or Safe Mode
    • PHP 301 Redirect Function with Headers Check and Javascript Fallback
    • Handy Easy Javascript
    • Demonoid is Back - The Return of Demonoid.com
    • Get Name from Email Address
    • Populating osCommerce and other Ecommerce Platforms

Edmonds Commerce related questions? Send us a message or call us on 0844 357 0201.

Freelance PHP Web Design UK Commercial Web Design