Solved

Images half grey after uploading on server through PHP

Posted on 2010-08-12
8
854 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now