File Downloads

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • robin@19.5degs.com

    File Downloads

    If a user is is downloading a file from the server via a php
    link...there are 2 ways I can do it..

    1. Create a symlink to the file and .. redirect user to it and delete
    the symlink later

    OR

    2. Just send appropriate headers to the browser and read the file to
    it.

    I was wondering which of these 2 approaches will take more resources.
    Is there a way to benchmark this?

    Regards,
    Robin

  • Phil

    #2
    Re: File Downloads

    robin@19.5degs. com wrote, On 22/09/06 6.38 a:
    1. Create a symlink to the file and .. redirect user to it and delete
    the symlink later
    I suspect that this would not only be more effort, but prone to a lot
    more failure.

    For example, how would you detect when the user has finished downloading
    the file and you need to clean up the symlink? How would you stop other
    people from grabbing this symlink and also downloading the file? How
    would you create unique symlinks? What if you run into filesystem
    limitations?

    -Phil

    Comment

    Working...