Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multipart HTML page for file downloading - Need help

Status
Not open for further replies.

digweed

Programmer
Nov 17, 2002
3
CA
Hi
first of all I'm a newbie...

I am building a download manager. On the last step of the download process, I want to give the use html page with the file details and to start the download automatically while the HTML page in background.
I assume that in order to do so I need to create a multipart HTML page (please correct me if I'm wrong). The problem is that I don't know how to write the multipart code. I didn't find any articles about it. Can anyone help ?


Thanks :)
Oren
 
to create a multipart HTML, you can create a document using server push statements in the CGI.pm

(From CGI.pm manpage)

Code:
Here is a simple script that demonstrates server push:

  #!/usr/local/bin/perl
  use CGI qw/:push -nph/;
  $| = 1;
  print multipart_init(-boundary=>'----here we go!');
  foreach (0 .. 4) {
      print multipart_start(-type=>'text/plain'),
            "The current time is ",scalar(localtime),"\n";
      if ($_ < 4) {
              print multipart_end;
      } else {
              print multipart_final;
      }
      sleep 1;
  }

For more details, see CGI.html#server push ---
cheers!
san.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top