Results 1 to 4 of 4

Thread: redirect header, downloading files question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76

    redirect header, downloading files question

    I need to write some sort of downloading system, I have the login and encryption complete. But the downloading of the file is where I have hit a wall. There can be no javascript, just in case the user has it off.

    I need the system to redirect the user to a file for download, which I have accomplished, but then I need the rest of the scripts on the page to complete.

    Is there a way to have the file downloaded and then pass control back the script so that it can remove the file and other various clean up?

    Thanks

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: redirect header, downloading files question

    You could route the entire file through your script.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: redirect header, downloading files question

    Are you wanting the script to continue executing after you have sent the redirect header??

    If so, then yes, this is possible, you need to make a call to the ignore_user_abort() function.
    PHP Code:
      ignore_user_abort(true);
      
      
    header('Location: newlocation.php');
      
      
    /* rest of script here */ 
    Be careful using this though as you will not recieve any notification of script errors and any output after the connection has been closed is lost in oblivion.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    76

    Re: redirect header, downloading files question

    Thanks, I will give it a try.

Posting Permissions

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



Click Here to Expand Forum to Full Width