PHPNewbie55 Posted April 9, 2009 Share Posted April 9, 2009 Hello, I have to move and rename thousands of logo images.. from one server to another Each image is under 20kb... Here is what I have: echo copy("http://content.someurl.com/images/brand/thumb/".$logo."","blogos/".$logo.""); Now this is just a test to see if I can move one image... The image is created in blogos/".$logo." BUT.. it isn't an image it doesn't load.. Any ideas on how I could move these images easily..?? copy doesn't seem to be working... Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/ Share on other sites More sharing options...
MadTechie Posted April 9, 2009 Share Posted April 9, 2009 Not really the best tool for the job! Why not use good old FTP! copy does support copying from URL's since PHP v4.3.0, I am not sure what you mean but its an image but doesn't load! did it copy correctly or not ? Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805920 Share on other sites More sharing options...
PHPNewbie55 Posted April 9, 2009 Author Share Posted April 9, 2009 Well it copied something.... for example... one of the files it copied was logo.jpg.. When I try to load logo.jpg from the destination.. it FAILS... 404 error.. When I look at it in my FTP program... there it is... I think it is not recognizing the format as JPG so it fails... Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805939 Share on other sites More sharing options...
MadTechie Posted April 9, 2009 Share Posted April 9, 2009 #1 are you SURE that you have everything correct with the URL #2 Check permission for that folder. #3 create a HTML page.. ie example.html, and view it to check Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805945 Share on other sites More sharing options...
PHPNewbie55 Posted April 9, 2009 Author Share Posted April 9, 2009 Yes I have done all of that... I have checked just about everything I can think of.. #1 url is fine... #2 permission is 777 #3 done everything works and pages saved - viewed to check... could it be a file permission in the original folder..?? could it be a server setting not allowing me to do this..?? Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805951 Share on other sites More sharing options...
PHPNewbie55 Posted April 9, 2009 Author Share Posted April 9, 2009 I just found out what is wrong with it.... right now I have it set to only grab one logo... and then to test it when complete I load both the original and the moved file to view... When I look at the properties of the original it is a JPEG FILE... When I look at the properties of the moved file it is a TEXT/HTML FILE.... I have no idea how to copy it and keep the file type intact... any ideas..? Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805955 Share on other sites More sharing options...
MadTechie Posted April 10, 2009 Share Posted April 10, 2009 its probably the mime type is not setup in the server.. the copy code doesn't touch the file extension.. okay some more tests #1 upload a file via FTP and test via browser #2 upload a file via PHP and download via FTP and test locally if the last test(#3) had failed i would of said change permission to 755 as some host block all files on 777 Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805973 Share on other sites More sharing options...
PHPNewbie55 Posted April 10, 2009 Author Share Posted April 10, 2009 Ah HA... OK it's fixed. You see in order to rename the individual logos I had to strip out the extension to be able to include it in the new file name... There was a freakin SPACE after the file extension...!!! So I couldn't see it on the server and it made the images not load correctly. It was basically working the entire time I just had to strip out the space... Space Cadet......... Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-806237 Share on other sites More sharing options...
PHPNewbie55 Posted April 10, 2009 Author Share Posted April 10, 2009 Oh yea... Space Strippers.. gotta love the green ones!!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-806238 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.