user642178
user642178

Reputation:

PHP copy() error

I'm getting error while using php function copy()

Warning: copy() [function.copy]: Couldn't resolve host name in

Warning: copy(http://www.foodtest.ru/images/big_img/sausage_3.jpg) [function.copy]: failed to open stream: operation failed in

what's wrong with that url?

Upvotes: 3

Views: 14718

Answers (3)

marble
marble

Reputation: 61

a little old, but important to pay attention, in case this helps someone who gets here:

copy command is folder-case sensitive, so if you try to copy 1.jpg from a folder called "ThumbImages" like that:

copy("thumbimages/1.jpg","[destination...]")

it will not find the folder.

notice you are using upper or lower case that matches the folder name

  • I just reached this post while trying to figure out an issue and now that it is solved, I hope it will help others.

Upvotes: 0

a.stgeorge
a.stgeorge

Reputation: 304

Try plugging in a destination argument and make sure to have the soft ticks around the arguments.

copy("http://www.foodtest.ru/images/big_img/sausage_3.jpg", "./file.jpg");

Upvotes: 1

Raja
Raja

Reputation: 442

Try enclosing the url withing quotes "".

Upvotes: 2

Related Questions