PHP image upload grey lines

kandip

New Member
I have a custom drupal module which saves uploaded files passed from the uploadify jquery plugin. All seemed well but some images are coming up with grey blocks in them. See:http://5oup.net/sites/default/files/360/5ouppic.jpgThis is a user submitted image and I'm unable to reproduce the problem myself - as I understand it it's a server side problem, but I'm unsure about how to rectify the issue.Here is the PHP from my module which handles the upload:\[code\]$tempFile = $_FILES['Filedata']['tmp_name'];$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';$filename = $_FILES['Filedata']['name'];$filename = preg_replace("/[^A-Za-z0-9. ]/", '', $filename);$filename = str_replace(" ", '_', $filename);$targetFile = str_replace('//','/',$targetPath) . $filename; $name = $filename;mkdir(str_replace('//','/',$targetPath), 0755, true);move_uploaded_file($tempFile,$targetFile);\[/code\]Is the upload 'stalling' somehow? Any ideas about why it would only be on some images and not others? Any help is very gratefully received!JamesEDIT - Able to reproduce problemI have contacted a user and am able to recreate the problem (i.e. it uploads with grey pixels every time) using this jpeg:http://5oup.net/test/sucon.jpgThis jpeg uploads fine:http://5oup.net/test/hd.jpgI just can't figure out the difference?! What on earth could be going on?Thanks
 
Back
Top