HTTP Get

Last post 12-12-2007 11:57 PM by GarciaG. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 12-07-2007 9:17 PM

    HTTP Get

    Is there a way to rename a file for download purposed in the HTTP Get request?  My problem is that I rename every file that get's uploaded to a system generated name (to avoid duplication and handle the files better) and then I just track file name changes by the client in the DB without ever actually renaming the file on Nirvanix.  When i do the Http Get for the file it uses the nirvanix file name but I want the save dialog box to show the file name I have saved in the DB.  Is there any way to do that like sending the FileName as part of the http response header or something like that.  My only other choice is to rename the file to download it and rename it again or copy the file with the actual name (which costs money because of storage) which is a harder process to keep track of.

    Thx,
    German Garcia

  • 12-11-2007 7:10 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: HTTP Get

     After some experimentation we have a fix.  Since we offer the ability to modify the file headers by passing disposition=attachment or disposition=inline we also allow setting additional information in this same request.  The idea is to add to the headers from the same interface.  Some examples are below:

    http://nodeX.nirvanix.com/appname/username/ABC123321.txt?disposition=attachment;filename=DisplayFilename.txt

     

    http://nodeX.nirvanix.com/appname/username/ABC123321.txt?disposition=inline;filename=DisplayFilename.txt

    The one caveat is the resulting header will display two filenames.  Later we will release a correction that will replace any header parts with the one you specified but for now, this works in the browsers we have tested.

    Let me know if this helps in your case.

    Regards,
        Barry R.
     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 12-11-2007 10:18 PM In reply to

    Re: HTTP Get

    The concept works perfectly for what I'm trying to do.  However, it doesn't seem to work for me.  I've tried it in IE7 and FireFox 2.0

  • 12-11-2007 10:49 PM In reply to

    Re: HTTP Get

    The actual fine name was F-132.pdf and i tried renaming it to ABC.pdf for testing and it didn't work. 

  • 12-11-2007 11:11 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: HTTP Get

    I have generated a file and shared it to help deduce the problem: 

    http://node1.nirvanix.com/Upload%20Test/uploadtest/testfolder/greensunset.jpg?disposition=attachment;filename=BlueSky.jpg

    This file should prompt for saving BlueSky.jpg

    Let me know what your results are.

    Regards,
        Barry R.
     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 12-12-2007 2:11 AM In reply to

    Re: HTTP Get

    That worked for me. I wonder what's going on.  My files are private and I use the following syntax.  I tried taking the dash out of the name so i tried the following call.

    http://node1.nirvanix.com/<session token>/<appname>/<user>/<folder>/F138.pdf?disposition=attachment&filename=abc.pdf

     I get the file but I get F138.pdf not ABC.pdf

  • 12-12-2007 8:23 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: HTTP Get

     Perhaps you can investigate the returned header to see what the result is.  Using WFetch on the link I supplied earlier the returned headers are:

    HTTP/1.1 200 OK\r\n
    Date: Wed, 12 Dec 2007 20:20:42 GMT\r\n
    Server: Microsoft-IIS/6.0\r\n
    X-Powered-By: ASP.NET\r\n
    X-AspNet-Version: 2.0.50727\r\n
    Content-Length: 149011\r\n
    Content-Disposition: attachment;filename=BlueSky.jpg; filename*=UTF-8''greensunset.jpg\r\n
    Content-Transfer-Encoding: binary\r\n
    Accept-Ranges: bytes\r\n
    Cache-Control: private, must-revalidate, max-age=0\r\n
    Last-Modified: Mon, 23 Jul 2007 18:14:15 GMT\r\n
    ETag: a76e726a-6da01c82\r\n
    Vary: *\r\n
    Content-Type: image/jpeg\r\n
    \r\n

    The line below defines the filename.  In this case the value follows attachment.  Try to get the headers from your download link and see if its doing the same thing.  

    Content-Disposition: attachment;filename=BlueSky.jpg; filename*=UTF-8''greensunset.jpg\r\n

    Regards,
        Barry R.
     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 12-12-2007 9:04 PM In reply to

    Re: HTTP Get

    When I use WFetch the content-disposition line is as follows:

    Content-Disposition: attachment; filename*=UTF-8''f-138.pdf\r\n

     It doesn't show the new filename that I added.  What could be the problem?  It works with the link you gave me but not with the link I'm using.

  • 12-12-2007 9:58 PM In reply to

    • BarryR
    • Top 10 Contributor
    • Joined on 07-20-2007
    • San Diego
    • Posts 614

    Re: HTTP Get

    I just saw the issue:

    ?disposition=attachment&filename=abc.pdf

    should be

    ?disposition=attachment;filename=abc.pdf

    Let me know if this helps.

    Regards,
        Barry R.

     

    IM Support (Feel free to add me)

    MSN: barryruffner@msn.com
    Gmail: barryruffner@gmail.com
  • 12-12-2007 11:57 PM In reply to

    Re: HTTP Get

    That did the trick.  Thank you very much.  This solves a huge problem for me.  You guys are being very proactive in adding needed functionality.  That's one of the reasons why i switched from S3.

     

     

Page 1 of 1 (10 items)