Hello everyone!
I am using copy() function to take images from external websites and copy them onto my server.
It worked fine for almost all websites, however, I came across one website... All images that I try to read and copy eventually come to my server as corrupt. They are all of the same size (27 smth kbytes).
I tried replacing copy() with file_get_contents() and got exactly same result.
Website is not https, so I do not know, what might be the reason.
Have you ever come across this problem or have any idea, what might be the problem?
copy() function problem
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: copy() function problem
The server probably implements some kind of hotlinking protection. You can use cURL to more closely manipulate the request to look like a real users request (user agent, referer, etc).