Re: Upload to a diferent site
| From: | Manuel Couto | Date: | Mon, 26 Jan 2004 15:40:55 +0000 |
| Subject: | Re: Upload to a diferent site | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-22660@lists.php.net to get a copy of this message | ||
Thanks Anthony for your help.
I already checked the php.ini and I have the <allow_url_fopen = On> in the
Fopen wrappers section and all the permitions to the upload folder but still
get the error:
Unable to create 'http://www.site.com/upload/image.jpg':
Invalid argument in
...
This PHP script works well if I change the URL to a path in the same site
Have you any idea what causes this?
Thanks in advance
Manuel
"Anthony" <atampone@attechcomputer.com> wrote in message
news:20040122164549.50893.qmail@pb1.pair.com...
> Yup, from the PHP docs: "Note: As of PHP 4.3.0, both source and dest may
be
> URLs if the "fopen wrappers" have been enabled. See fopen() for more
> details. If dest is an URL, the copy operation may fail if the wrapper
does
> not support overwriting of existing files. "
>
> You'll need to ensure you can access the remote server with the correct
> permisions though.
>
> - Anthony
>
>
> "Manuel Couto" <manuel.couto@renova.pt> wrote in message
> news:20040122164057.40959.qmail@pb1.pair.com...
> > does any one know if is possible to upload an image to a diferent site
> from
> > the one where the PHP script is running?
> >
> > something like this:
> >
> > Im running this script from "site1"
> >
> > $users_file="image1.jpg";
> > $copy_path="www.site2.com/images";
> >
> > if(!copy($users_file, $copy_path)) {
> > echo "<font face=\"Arial\">A imagem não foi
> > publicada!</font>";
> > }
> >
> > Is this operation possible in PHP?
> > Could anyone help me please?
> >
> > Tanks in advance
> > Manuel