Download under a different filename

Discussion in 'ASP General' started by andylong :: andrea : azzini, Nov 1, 2004.

  1. My problem is: i need to write an ASP page which first checks whether
    the user has permissions to download a ZIP file, and then streams the
    file itself if the user is allowed to see it. I have succeeded until
    this point, but the client browser asks to save the file with the
    original filename (and ASP extension). Obviously this would mean
    making the downloaded file unusable at client side, unless I tell the
    site user to manually rename it, but this is not a solution.

    So I ask you: is there any way for an ASP page to stream data to the
    browser and have it saved with a default file name and extension which
    are different from the page's ones?

    I have tried a PHP-like solution:
    http://server/path/page.asp/virtual.zip but IIS seems not to
    understand the trick.

    Thanks in advance to anyone who might reply this post!
    Andrea Azzini
     
    andylong :: andrea : azzini, Nov 1, 2004
    #1
    1. Advertising

  2. works perfectly! thanks you very much!

    "Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
    news:%...
    > Something like this will work. You can rename the file on the fly to
    > whatever you want.
    > http://www.darkfalz.com/1098
    >
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > Site: http://www.Darkfalz.com
    > Blog: http://blog.Darkfalz.com
    >
    >
    > "andylong :: andrea : azzini" <> wrote in message
    > news:%23%...
    > > My problem is: i need to write an ASP page which first checks whether
    > > the user has permissions to download a ZIP file, and then streams the
    > > file itself if the user is allowed to see it. I have succeeded until
    > > this point, but the client browser asks to save the file with the
    > > original filename (and ASP extension). Obviously this would mean
    > > making the downloaded file unusable at client side, unless I tell the
    > > site user to manually rename it, but this is not a solution.
    > >
    > > So I ask you: is there any way for an ASP page to stream data to the
    > > browser and have it saved with a default file name and extension which
    > > are different from the page's ones?
    > >
    > > I have tried a PHP-like solution:
    > > http://server/path/page.asp/virtual.zip but IIS seems not to
    > > understand the trick.
    > >
    > > Thanks in advance to anyone who might reply this post!
    > > Andrea Azzini
    > >
    > >

    >
    >
     
    andylong :: andrea : azzini, Nov 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Extract filename from a filename typed by user

    =?Utf-8?B?Sm9l?=, Aug 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,062
    Travis Murray
    Aug 24, 2004
  2. Replies:
    1
    Views:
    1,573
    Roland de Ruiter
    Jun 15, 2006
  3. Ed
    Replies:
    10
    Views:
    46,550
    alok000707
    Jul 13, 2010
  4. Beauregard T. Shagnasty

    Re: filename.gif or filename.gif.jpg?

    Beauregard T. Shagnasty, May 30, 2008, in forum: HTML
    Replies:
    1
    Views:
    793
    Jonathan N. Little
    May 30, 2008
  5. Bergamot
    Replies:
    0
    Views:
    474
    Bergamot
    May 30, 2008
Loading...

Share This Page