bothwell Posted September 25, 2009 Share Posted September 25, 2009 Hi guys, one of my clients has been having problems for a long time with image uploading - I've tried several methods to try and get it working, and thought "hurrah! Finally!" when they reported success using Uploadify. You can imagine my disappointment when I got an email saying 'oh, I tried it from the laptop at home and it wouldn't work'. The code process goes like this: Image comes in through $_FILE Gets a new name set move_uploaded_file does its stuff image is resized to sane dimensions A record is put in a database I've learned now that what happens when it fails is that the code steps through to move_uploaded_file and then fails on the resize method. There's nothing actually wrong with the resize method - I have never been able to replicate the behaviour my client is reporting on any machine, it always works for me. Moreover, the behaviour only apparently occurs on certain machines. What on earth could be causing this? Script timeouts if they upload gigantic files? But why would it only happen on certain boxes? The time of day doesn't seem to matter either. I'd really appreciate any ideas you guys might have about where the problem could be, this is completely beyond me. Mods feel free to move this if it's in the wrong place - couldn't quite decide if I need PHP help or server help! Quote Link to comment https://forums.phpfreaks.com/topic/175476-image-processing-conundrum/ Share on other sites More sharing options...
RussellReal Posted September 25, 2009 Share Posted September 25, 2009 are you checking the image you're trying to create a resource for it's mime type? that way you can use the correct function to open that file? Quote Link to comment https://forums.phpfreaks.com/topic/175476-image-processing-conundrum/#findComment-924654 Share on other sites More sharing options...
bothwell Posted September 25, 2009 Author Share Posted September 25, 2009 Only jpg files can be uploaded by design, so it can't be a filetype problem. Sometimes if a different machine is used, the exact same file can be uploaded and then processed properly, so I'm confident there aren't any problems with the functions that are being used, something else strange is going on. Honestly, script time-out is my only idea at this point, but even that doesn't make a lot of sense given that the problem is so sporadic. Quote Link to comment https://forums.phpfreaks.com/topic/175476-image-processing-conundrum/#findComment-924675 Share on other sites More sharing options...
MadTechie Posted September 25, 2009 Share Posted September 25, 2009 Without seeing any code anything is going to be guess work, if its the resize script then its likely to be a timeout or memory, you can probably remove that possibility but asking the client to upload a file, that you have already uploaded and tested (a very small jpeg), checking the error logs may reveal the problem, or you could even echo a message at different parts ie File uploaded FileType Check FileType Passed File moved File Resized File added to database etc Quote Link to comment https://forums.phpfreaks.com/topic/175476-image-processing-conundrum/#findComment-924679 Share on other sites More sharing options...
bothwell Posted September 25, 2009 Author Share Posted September 25, 2009 Yeah, it's all guess-work for me, too, especially since I can't replicate the problem at all! I'm calling imagedestroy() at the end of the resize, but I guess the problems are starting before it even gets to that point. Good call on the error logs, I'll enable those and see what transpires. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/175476-image-processing-conundrum/#findComment-924687 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.