Solved

Images half grey after uploading on server through PHP

Posted on 2010-08-12
8
867 Views
Last Modified: 2013-12-06
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
Comment
Question by:tech1984
8 Comments
 
LVL 4

Expert Comment

by:stevepicks
ID: 33424186
have a look at this:
http://roshanbh.com.np/2008/01/uploading-larger-files-in-php.html
hope it helps
Cheers
0
 

Author Comment

by:tech1984
ID: 33424888
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
 
LVL 1

Expert Comment

by:voxxter
ID: 33425397
On what kind of server are you having the problem? Is it a shared hosting account or hosting solution?
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 8

Expert Comment

by:ropenner
ID: 33425613
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
 
LVL 15

Expert Comment

by:samri
ID: 33427794
HI,

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

0
 

Author Comment

by:tech1984
ID: 33429293
@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
 
LVL 8

Accepted Solution

by:
ropenner earned 500 total points
ID: 33432272
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
 

Author Closing Comment

by:tech1984
ID: 33432359
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question