Well, currently I’m working on my project filesio, a platform for distributing large files via web interface instead of FTP.

One of the core abilities of my application is to provide widgets for third-party sites, allowing my users to include download-links to their files in their own web pages. These widgets are simple iframes that load content from my domain.

However, when implementing my app I struggled with the problem that Microsoft Internet Explorer per default blocks cookies set from within an iframe (of course, all other browsers don’t do this).

Lucklily, I found a really ..hm…interesting solution for this problem:

Read more…

There are many scenarios where a web application must serve a file instead of a response containing HTML output to be rendered by the browser.

This little tip illustrates how to cause the browser to display a file download dialog instead of trying to display the data directly (which fails in most cases, especially with binary data).

As you will see, the whole magic concentrates on a special HTTP header, so this tip can be used with any technology and framework, ranging from Java Server Faces (JSF) and the Seam framework to PHP and even ASP or ASP.NET.

A common way to realize file download is to simply write the file data into the HTTP response.

However, if you have to handle arbitrary files, you are not able to set a specific Content-Type header like text/plain or something else.

So the client (namely the browser) has no idea what kind of data it actually receives and what to do with it.

Here is where the HTTP header Content-Disposition comes into play. Setting this header tells the client that an attachment is received and therefore causes the browser to display a file download dialog.
Now it’s the user’s responsibility to save the file and to open it with a corresponding application.

The Content-Disposition header consists of two values: the string “attachment” indicating an attachment and a “filename” property specifying a filename for the attachment. Usually, the browser takes this value as proposed filename in the download dialog.

The following line is an example extract from an HTTP response containing a Content-Disposition header:

Content-Disposition: attachment; filename="myFile.exe"

Recently I visited Jazoon, an international conference for Java developers at Zurich, Switzerland.

Having heard a lot of interesting talks, I want to sum up my impressions and try to figure out some of the latest trends in the world of Java as well as interesting facts for software architects.

This is part 3 of my series of blog posts and deals with

Ajax Push

Having worked with ICEfaces (but suspended work for now due to a lot of bugs), I was curious to hear a talk of one of the guys of ICEfaces, Ted Goddard.

The topic was Ajax Push. Surely, Ajax is a buzzword of today and everybody wants to have some Ajax functionality in his application, maybe just to be cool.

Read more…