getting files over ftp/http

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cleverbum@hotmail.com

    getting files over ftp/http

    Before I go on a mad quest to try to code some pages, I think it's
    probably prutent to ask something. If I were to pass a php page either
    an ftp or http address of an image file (assuming it had a username and
    password coded in), would I be able to make it go and get that file and
    save it in a folder local to that page?

  • Rik

    #2
    Re: getting files over ftp/http

    Cleverbum@hotma il.com wrote:
    Before I go on a mad quest to try to code some pages, I think it's
    probably prutent to ask something. If I were to pass a php page either
    an ftp or http address of an image file (assuming it had a username
    and password coded in), would I be able to make it go and get that
    file and save it in a folder local to that page?
    As far as I understand your question, perfectly.
    Look into fopen(). (Check wether allow_url_fopen is enabled in your
    settings), or look at the PHP FTP functions:


    Grtz,
    --
    Rik Wasmus


    Comment

    • Armando Padilla

      #3
      Re: getting files over ftp/http

      Rik wrote:
      Cleverbum@hotma il.com wrote:
      >
      >>Before I go on a mad quest to try to code some pages, I think it's
      >>probably prutent to ask something. If I were to pass a php page either
      >>an ftp or http address of an image file (assuming it had a username
      >>and password coded in), would I be able to make it go and get that
      >>file and save it in a folder local to that page?
      >
      >
      As far as I understand your question, perfectly.
      Look into fopen(). (Check wether allow_url_fopen is enabled in your
      settings), or look at the PHP FTP functions:

      >
      Grtz,

      Try using file_get_conten ts works alot better when it comes to opening
      URLS since the stream might be caught off when using fopen.

      Concerning if you can download the image straight from a URL
      call...hummmmmm m

      #1. What you can do is hit the page
      #2. Remove all references (image paths) from the page
      #3. Open up the images individually using imagefromjpg($p ath) <-- ?
      #4 Save the stream that the imagefromjpg returns as a jpg file. :-)



      Armando Padilla

      Comment

      Working...