Re: [PHP] Can anyone help me save img from URL?
BINGO!! thank you guys for your input I used a very simple command to accomplish that and it works!! http://domain.com/images/somepic.gif";; system( $command, $result); echo $result; ?> Victor Polyushko - Original Message - From: "Robert Cummings" <[EMAIL PROTECTED]> To: "Victor Polyushko" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, May 16, 2002 2:25 PM Subject: Re: [PHP] Can anyone help me save img from URL? > Victor Polyushko wrote: > > > > Hi Guys, > > > > Thank you fo your input. I am sorry I am new to the list so + English is not > > my first language :-( anyhow., I shoudl 've made my question more clear. > > > > I am trying to save the image from the given URL > > (http://domain.com/image.gif) running a PHP script on the page. I have tried > > fread() and it does not allow me to accomplish that :-(( > > > > Have you guys ever come across such a problem? > > $imageData = implode( '', file( 'http://domain.com/image.gif' ) ); > $length = strlen( $imageData ); > > if( $length > 0 ) > { > if( (fh = fopen( 'destination', 'w' )) ) > { > fwrite( fh, $imageData ); > } > } > > > Cheers, > Rob. > -- > .-. > | Robert Cummings | > :-`. > | Webdeployer - Chief PHP and Java Programmer | > :--: > | Mail : mailto:[EMAIL PROTECTED] | > | Phone : (613) 731-4046 x.109 | > :--: > | Website : http://www.webmotion.com | > | Fax : (613) 260-9545 | > `--' > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can anyone help me save img from URL?
Victor Polyushko wrote: > > Hi Guys, > > Thank you fo your input. I am sorry I am new to the list so + English is not > my first language :-( anyhow., I shoudl 've made my question more clear. > > I am trying to save the image from the given URL > (http://domain.com/image.gif) running a PHP script on the page. I have tried > fread() and it does not allow me to accomplish that :-(( > > Have you guys ever come across such a problem? $imageData = implode( '', file( 'http://domain.com/image.gif' ) ); $length = strlen( $imageData ); if( $length > 0 ) { if( (fh = fopen( 'destination', 'w' )) ) { fwrite( fh, $imageData ); } } Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can anyone help me save img from URL?
Hi Guys, Thank you fo your input. I am sorry I am new to the list so + English is not my first language :-( anyhow., I shoudl 've made my question more clear. I am trying to save the image from the given URL (http://domain.com/image.gif) running a PHP script on the page. I have tried fread() and it does not allow me to accomplish that :-(( Have you guys ever come across such a problem? Again thank you very much for your suggestions Best Regards, Victor Polyushko - Original Message - From: "Robert Cummings" <[EMAIL PROTECTED]> To: "Miguel Cruz" <[EMAIL PROTECTED]> Cc: "Victor Polyushko" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, May 16, 2002 2:01 PM Subject: Re: [PHP] Can anyone help me save img from URL? > Miguel Cruz wrote: > > > > On Thu, 16 May 2002, Victor Polyushko wrote: > > > I was wondering if someone knows how to save the image from the given > > > url http://domain.com/image.gif into a file on a local machine > > > > lynx -source -dump > image.gif > > If there were actually an image I'd use: > > wget http://domain.com/image.gif > > Cheers, > Rob. > -- > .-. > | Robert Cummings | > :-`. > | Webdeployer - Chief PHP and Java Programmer | > :--: > | Mail : mailto:[EMAIL PROTECTED] | > | Phone : (613) 731-4046 x.109 | > :--: > | Website : http://www.webmotion.com | > | Fax : (613) 260-9545 | > `--' > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can anyone help me save img from URL?
Miguel Cruz wrote: > > On Thu, 16 May 2002, Victor Polyushko wrote: > > I was wondering if someone knows how to save the image from the given > > url http://domain.com/image.gif into a file on a local machine > > lynx -source -dump > image.gif If there were actually an image I'd use: wget http://domain.com/image.gif Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can anyone help me save img from URL?
On Thu, 16 May 2002, Victor Polyushko wrote: > I was wondering if someone knows how to save the image from the given > url http://domain.com/image.gif into a file on a local machine lynx -source -dump http://domain.com/image.gif > image.gif miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can anyone help me save img from URL?
As fas as I know, the only way to do this is to give somebody instructions to right click on the file and so "Save As". Plan B is to put the GIF in a ZIP file and let it be downloaded like that. Best Regards, Patrick Lynch. Optip Ltd, Internet & Mobile Development Co. Clare, Ireland. http://www.optip.com/ -Original Message- From: Victor Polyushko [mailto:[EMAIL PROTECTED]] Sent: 16 May 2002 18:05 To: [EMAIL PROTECTED] Subject: [PHP] Can anyone help me save img from URL? Hi, I was wondering if someone knows how to save the image from the given url http://domain.com/image.gif into a file on a local machine Any suggestion will be greatly appreciated. Thank you in advance Victor Polyushko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can anyone help me save img from URL?
Hi, I was wondering if someone knows how to save the image from the given url http://domain.com/image.gif into a file on a local machine Any suggestion will be greatly appreciated. Thank you in advance Victor Polyushko