Jump to content

[SOLVED] Move Images


PHPNewbie55

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/153399-solved-move-images/
Share on other sites

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...

 

 

Link to comment
https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805939
Share on other sites

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..??

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805951
Share on other sites

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..?

Link to comment
https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805955
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-805973
Share on other sites

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......... :)

Link to comment
https://forums.phpfreaks.com/topic/153399-solved-move-images/#findComment-806237
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.