Syed Anwaruddin wrote:
> 
> Hi ALL,
> 
> I have a minor problem. I am using the statement print"Location: $zipfile"
> for downloading the file to my client system. After downloading I am
> deleting the file from the Server.
> 
> The code logic is, I have a parent process which starts a child process.
> Child Process does the tar and zip of files and returns it to Parent
> process. Mean While Parent Process keeps the browser busy(Not letting the
> timeout problem to occur).
> 
> the part of code is:
> 
> my $zipfile = "assembly$now_id.tar.gz";
> 
> if (($zipfile) && (-e $zipfile)) {
>    if (($userAgent =~ /MSIE/i) && ($current_status ne $last_status)){
>         $last_status = $current_status;
>         $initial_delay = 0;
>     }
>     elsif ( open( ZIP, "<$zipfile") ) {
>         # print zip file
>         if ( $Platform =~ /W./ ) {
> 
>             $file = "\$zipfile";
>             print "Location: $temp$file\n\n";
> 
>         }
>         else {
> 
>             $sitename = "file:";
>             print "Location: $sitename$temp/$zipfile\n\n";
>            # print "Content-type: application/x-zip-compressed\n\n";
> 
>         }
>         #print "Content-type: application/x-zip-compressed\n\n";
> 
>         binmode(STDOUT);
>         binmode(ZIP);
>         while (<ZIP>) {
>            print $_;
>         }
>         close(ZIP);
>         unlink("$zipfile");
> 
> When I am trying to delete the file, I am getting error as "File not found
> on the Server".
> 
> How to control deleting the file($zipfile) from Server using Location
> Statement???
> 
> If I use  print"Content-type: aplication/x-zip-compressed" MIME type I am
> getting Save As Dialog Box. but my  zipfile is not coming as default in
> Dialog Boz Selection field. No Problem Server file gets deleted and NO
> error.
> 
> Code works well when  the $zipfile is not deleted from Server( I mean print
> "Location: $zipfile" works). Any How I am using unlink command after print
> "Location:............" Then WHy this is giving me as FILE NOT
> FOUND????????????????
> 
> Please help me controlling this scenario!!

1) You could change your location to point to a Perl script that would do the 
download and delete the file after.

2) You could have the next execution of the script remove any left over files 
from previous runs that are more than an hour or two old.

3) You could have a cron job do the same as 2).

-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED] 
  / ) /--<  o // //      http://dbecoll.webjump.com/ (Free Perl site)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
  • Help Syed Anwaruddin
    • $Bill Luebkert

Reply via email to