Making image files downloadable for Nokia Asha Web Apps
This article explains how to make image files downloadable for Nokia Asha Web Apps 2.0 Beta
Article Metadata
Tested with
Compatibility
Article
Overview
Series 40 web apps 2.0 Beta brings support for downloading files. However image files located in remote server do not trigger downloading process unless server is configured to do so. This article describes how image files can be made downloadable in Apache server environment.
Making image files downloadable
The magic word, which enables Nokia Browser to download images, instead of just showing them, is Content-Disposition header (http://www.ietf.org/rfc/rfc2183.txt). Downloading is forced by setting Content-Disposition to attachment and specifying filename. Specified file name is presented to the user in browser’s download dialog. One common way is to use PHP to write content disposition header.
Another way to achieve the same functionality is to use Apache’s mod_headers module. Mod_headers directive provides convenient way to add headers to all of the files with certain extension. Even better, mod_headers directives can be added to .htaccess file. Following code adds Content-Disposition header to all of the *.jpg image files in current directory. Thus now when trying to access any image file in that directory, browser downloads it instead of just showing it.
<FilesMatch "\.(jpg)$">
ForceType image/jpeg
Header set Content-Disposition attachment
</FilesMatch>


(no comments yet)