Hey everyone,
I am currently updating a website and need to copy all of the image files from the existing site to the new site. These are embedded within img tags and so i have written some code to extract the image url and then use the php copy command to copy them across. I am having a complete nightmare with filenames with spaces, it will not seem to copy them. I have replaced all spaces with %20 and this worked once and copied the files across correctly, but since then it will not work, i cannot see why. I have created a very simple file to test it, which for some reason now does not seem to work (it did once). The code is:
<?
$orig='http://www.olddomain.com/files/STAN T1 Q16 P10.JPG';
$orignospaces='http://www.olddomain.com/files/STAN%20T1%20Q16%20P10.JPG';
$dest='images/uploaded/test.jpg';
copy($orignospaces,$dest);
?>
Can anyone explain why this doesn't work (it just creates a 0kb file at images/uplaoded/test.jpg), what is particularly wierd is it did work once, i cannot for the life of me work out what's wrong?
Thanks so much for any help you can give in advance, this is driving me crazy!
Dave