I found a bug in Zend Studio for Eclipse the other day. I created a new QA subdomain for one of my web project. When I tried to view the new directory in Zend Studio for Eclipse, it wouldn’t show up. Nothing that I did in Zend Studio would make it show up.
It drove me nuts until I found a clue in this discussion on the Zend Forums. Zend Forum member adlorenz posted the clue, saying
. . . it seems like bug concerns only files/directories that have leap day date of last modification . . .
Turns out that any directory or file created or last modified on Feb 29 of this year won’t show up in FTP Remote Systems connections in Zend Studio for Eclipse. I logged into my account, touched the directories and files that were dated Feb 29 ($ touch dirname), and I could finally see the directories and files in the Remote Systems Explorer.
I’m working on a project that uses Zend_Gdata, specifically Zend_Gdata_Photos, to manage photos in Google’s Picasa Web Albums. When the application went into its testing phase, the image upload functionality began to throw exceptions. While I could upload photos to Picasa without issue, my business partner John couldn’t upload any photos at all. The application kept throwing the following error:
Error Message: Exception Message: Expected response code 200, got 400
Since the app worked fine for me, the issue didn’t seem to be with the code. After some frustrating, unproductive troubleshooting, I finally built a file upload mockup and ran the $_FILES array through Zend_Debug::dump(). I discovered that while Firefox reports the MIME type of a jpg as “image/jpeg”, Internet Explorer reports the MIME type as “image/pjpeg.” Thanks a lot, Redmond.
As it turned out, the problem occurred when I tried to set the upload content type to “image/pjpeg”:
$fd = $this->_service->newMediaFileSource($photo["tmp_name"]);
$fd->setContentType($photo["type"]);
I resolved the issue by adding a test for the pjpeg MIME type before setting the content type. The new code looks like this:
/** Resolves issue where IE changes jpg MIME type to image/pjpeg, breaking upload */
$photo["type"] = ($photo["type"] === "image/pjpeg") ? "image/jpeg" : $photo["type"];
$fd = $this->_service->newMediaFileSource($photo["tmp_name"]);
$fd->setContentType($photo["type"]);
The code snippets above come from an image upload helper method that I built (borrowing heavily from Cory Wiles) to make working with Zend_Gdata_Photos a little easier.
If you’re having similar problems uploading images, regardless of the method that you’re using, check that MIME type and see if that’s not the issue.
If you want / need to install Internet Explorer in Linux, I highly recommend IEs4Linux by Sérgio Lopes.
IEs4Linux is the simpler way to have Microsoft Internet Explorer running on Linux (or any OS running Wine).
I recently purchased a new Dell 1420n with Ubuntu 7.10 pre-installed. One of the first things I wanted to do was install all of my development tools, including IEs4Linux. What should have been an easy installation turned into a nightmare. I kept running into python errors that aborted the install. Once I finally got the application to install it was unusable. The IE toolbar was missing, including the address bar, the application would frequently crash, and I experienced maddening display bugs.
Apparently the blank screen bug has been a widespread issue. Sérgio has addressed it on his blog and pushed an emergency release of IEs4Linux, version 2.99.0.1, to resolve this issue only.
That’s all well and good, but I still had the python issues to deal with. What finally worked for me was to install IEs4Linux with the –no-gui flag, like so:
For more information on installing IEs4Linux, including IE versions 5 and 5.5, visit the IEs4Linux installation page.