Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 883
  • Last Modified:

Images half grey after uploading on server through PHP

When I upload multiple images, every now and then the images get jacked up like:

 Broken Image
Has anyone every had this problem? My upload limits are set to 90M for memory, and the files I am loading are about 20K a pieces. If I try say like 10 of them, maybe one will look like the above.. Any ideas? Another clue is that my other server (GoDaddy) does not have this problem and never fails to upload.
0
tech1984
Asked:
tech1984
1 Solution
 
stevepicksCommented:
have a look at this:
http://roshanbh.com.np/2008/01/uploading-larger-files-in-php.html
hope it helps
Cheers
0
 
tech1984Author Commented:
Thanks for your help, but I have tried everything regarding upping my limits.. I am able to upload 100 files and get the last one to look correct, but there are like 20 photos that look like the above. The kicker is that I can upload the same 100 photos and get different images that look like the above.. I am going crazy over this!!
0
 
voxxterCommented:
On what kind of server are you having the problem? Is it a shared hosting account or hosting solution?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
ropennerCommented:
Check the file sizes once uploaded.  Are they actually truncated or corrupt and the correct byte sizes.  If corrupt then it is network related.  Truncated could be dropped packets somewhere along the route to the server.

Running
    tracert <SOME IP ADDRESS>

on windows

or traceroute6 on UBUNTU linux or tracepath or another network analysis tool/command to find out if packets are being dropped along the way.
0
 
samriCommented:
HI,

Are you able to verify if the uploaded file size is the same as the source -- especially the one that is broken.

0
 
tech1984Author Commented:
@samri - I uploaded 12 of the same exact images and 3 were broke.. I looked at the size and they were all the same, however when I md5checksum, the broken images are in fact different.. this is after the move_uploaded_file() function is ran. The uploader I use is uploadify for jQuery, it seems to be working ok on our GoDaddy server, but not our own.

@voxxter - The server is ours that we can do whatever with.

I am starting to believe that this is a problem with the actual images moving from my computer to the server, however I don't know how to fix it, or even know were to start.

0
 
ropennerCommented:
Since it is your server, you can do a couple things to rule out problems.  The two possible problems from your description are:

1. Network path to your server is different so packets could be corrupted along the path to your server.

2. The network card on your server or another hardware related failure (memory, hard drive).

TRIAL #1
from a windows command prompt type in
   tracert -d IP_ADDRESS_OF_YOUR_SERVER
This will check the connections along the path from the computer sending the images to your server.  The default options for tracert should give a * instead of a millisecond PING  number  if anything gets dropped and has to be resent.  This dropping and resending is an indication that at that NODE/COMPUTER in the path to your server there is a network bottleneck or hardware related problem.

TRIAL #2
If you can swap out the network card,
or if it is a motherboard network connection, add a network card to test with.
run the same tests

I've had network cards die in the past, but not recently.  A server network interface is used continuously so it is the more likely device to die on a server.

This question may need to be posted to a forum on network troubles since that is not the expertise of this area anymore.  We've ruled out the possibility that it is APACHE or PHP related I believe.  More likely hardware and network hardware more specifically.

good luck


0
 
tech1984Author Commented:
It seems to be a network issue because I tried the script on a local server and it works perfect. Thanks for your time!
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now