×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    285

    how to call file downlaod of a picture

    Hello developers,

    I want to give the users a way to download pictures from my webapp.

    The release notes mention that is is possible now:
    http://www.developer.nokia.com/Resou...-versions.html

    There is even a link that explains the user experience. What I miss is how to invoke it.
    Maybe it is just too simple, I have not found it in the API.
    How do I create a button that downloads a image when clicked?

    Regards

    Karsten Meier

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: how to call file downlaod of a picture

    Hi,

    You will need to modify server config a little.
    In Apache this can be done in .htaccess
    Code:
    <FilesMatch "\.(jpg)$">
      ForceType image/jpeg
      Header set Content-Disposition attachment
    </FilesMatch>
    Br,
    Ilkka

  3. #3
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,801

    Re: how to call file downlaod of a picture

    Another way of doing this without changing server config,

    Code:
    <a href="http://example.com/myimage.png">
    <img src="http://example.com/myimage.png"/>
    </a>
    Basically, this would open the image in a separate browser for the user.
    The user can go to the options and save the image to his gallery.

    You can also use mwl.load to open the image in the browser.
    Pankaj Nathani
    www.croozeus.com

  4. #4
    Regular Contributor
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    285

    Re: how to call file downlaod of a picture

    Thanks,

    here are results from my experiments:
    I have now tested both options.
    The version with the header "content-disposition works nicely, user get a dialog to download, and the image is stored in gallery.
    The image is fetched in its original size and in my example with the same file size, so it looks like it is not transcoded.

    Adding the header in htaccess is not so optimal. In it simplest form I need to put the image two times on the server, one time in directory with htaccess and one without. Also in some projects you can not change the webserver, there is some CMS in place which you as a crazy mobile developer are not allowed to change.
    (After all that is why the mobile web proxy systems exist). I think I can get around this with a server-side script.

    The solution the the plain link and open in browser is the simplest to implement. Unfortunately the user experience feels weird. The user first waits, see the image again, need to understand that it is now the browser. To save the image, the user need then to tap the image long.
    What is nice is that the user can click upon the right lower corner to access the menu options, and then the user can clip the upper left menu and has even the option to share the picture via twitter.
    I don't think many users will understand it.

    What I like to have is a mwl.downloadURL(url) Method, as the functionality is already there, but now I can trigger it only from the outside with the http-header.

    Regards

    Karsten Meier

  5. #5
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,801

    Re: how to call file downlaod of a picture

    Quote Originally Posted by internetlabor View Post
    The solution the the plain link and open in browser is the simplest to implement. Unfortunately the user experience feels weird. The user first waits, see the image again, need to understand that it is now the browser. To save the image, the user need then to tap the image long.
    What is nice is that the user can click upon the right lower corner to access the menu options, and then the user can clip the upper left menu and has even the option to share the picture via twitter.
    I don't think many users will understand it.
    True, there is a learning curve for the user. However, if he's been using the browser for browsing other websites, theere's a good chance that he'll realize this.

    If you still feel uncertain about it.. may be instead of just having a link to the image, you could have a page containing an image and a description how to save it. Not ideal again but workable.

    Quote Originally Posted by internetlabor View Post
    What I like to have is a mwl.downloadURL(url) Method, as the functionality is already there, but now I can trigger it only from the outside with the http-header.
    Interesting, mwl.downloadURL(url) could then work for any file download (zip, image, audio, etc)
    Pankaj Nathani
    www.croozeus.com

  6. #6
    Regular Contributor
    Join Date
    Jun 2010
    Posts
    161

    Re: how to call file downlaod of a picture

    Quote Originally Posted by croozeus View Post
    Interesting, mwl.downloadURL(url) could then work for any file download (zip, image, audio, etc)
    Great idea, I'm all for it. In addition Nokia could remove this stupid file size limit for downloads which hindered me from enabling podcast downloads in the "The Verge Bingo" app.

Similar Threads

  1. how to downlaod a file by clicking a link
    By sanatkumarmeher1234 in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2008-09-12, 06:13
  2. grid menu example downlaod????
    By Honey_symby in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-02-19, 04:01
  3. 9500 ...picture of person when they call.....streaming?
    By Pecuniam in forum General Development Questions
    Replies: 0
    Last Post: 2005-04-08, 19:34
  4. How Downlaod File From Forum
    By jm95 in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-02-02, 13:28
  5. awb downlaod issue
    By lizards in forum Audio
    Replies: 2
    Last Post: 2003-12-17, 08:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×