SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Appending to a Response

    Does anyone know if it is possible to append data to a response?

    Here is my situation:

    A user must authenticate before they can download a given file. However, I'd like to hold off determining if they need to authenticate until they try to download. So if they are authenticated and they click on a download link, the download begins. If they are not authenticated and they try to download, the login prompt is displayed. Once they login successfully, the page they were previously on is displayed and the file they requested is streamed to the browser.

    Anyway, what I'd like to do, is after they authenticate, send the html and the file's contents to the browser all in one hit. As far as I can tell, I can only do one or the other in rails.

    Thanks,
    Steven

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I know, one or the other is the only way to do it also... but why must you do it all in one hit? Why can't you just "send_data" inline?
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer

  3. #3
    SitePoint Enthusiast Stevenwulf's Avatar
    Join Date
    May 2002
    Location
    Berkeley
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by sending the data inline?

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://api.rubyonrails.com/

    Look for the method "send_data" or "send_file"
    Happy switcher to OS X running on a MacBook Pro.

    Zend Certified Engineer


Bookmarks

Posting Permissions

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