Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
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
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.
Header set Content-Disposition attachment