August 2009 Archives

The task is simple: Let the user (or someone else) upload an image to your server and store it in a predefined location. Additionally you would like to store some information, e.g. an user name, an image title and a comment in a MySQL-Db. As an experienced programmer you will maybe take the Zend Framework.
To handle just a few images, this is no big thing. Make a Zend_Form and enable it to upload a file and store the information according to your model in the database. That is it.

Well thinking a little bit further you may think about the names of your files and what happens when there are two files (one on the server and one to be uploaded) with the same name. You have a conflict. To be more precise: without any intervention the newer file (the one to be uploaded) overwrites the existing file. You have to explain the user where the old image has gone and why there is another image twice in your database.

You have two solutions to this problem:
# Scan your directory upon validation if there already exists a file with this name (or maybe you have stored the filename in the database and query the database) and decide what to do: rename file or do not permit upload, e.g. return a false on validation.
# You can use own filenames based on a MySQL auto-increment value, e.g. the ID-Column which holds the additional information (user name, title, comment).

I will show you how to implement the latter solution. In a second tutorial I will show you how to access this files.

Green.ch Phone Support Hell

| No Comments

Following the principle of Jeff Jarvis (see this post here) I would like to write about my disappointing experience with the Green.ch (a Swiss ISP) phone support. Some short research has showed me also, that there are already existing complaints. Here a short excerpt (excuse me but the discussions are in German):

The story goes as follows:
On behalf of my customer I have opened a new Linux Hosting with Green.ch. This was already a pain, because I could not use the existing customer account (for other services from the provider). Instead I had to open a complete new one. The guy from sales needed about 15 minutes to get what I really wanted. But finally managed to answer all my questions.
So now the first trouble begins. My customer wanted to have an existing domain (bought on the market) for his new Internet presence. I had filled in the information correctly during the order and confirmed, that the customer is the legal owner of this domain.
The second mail I have got from Green.ch (the first was the confirmation of the order), had the content, that they somehow had different registration information and needed a confirmation of both parties (my customer and the former owner of the domain). Well the only point here is, that this has been done some (long) time ago and Green.ch has been informed. But for sure this has been on the existing user account. Since there is obviously no connection between the user accounts, this has not been detected by the staff.