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
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
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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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