[ic] Soft goods file download

Stefan Hornburg racke at linuxia.de
Wed Apr 6 17:02:03 EDT 2005


On Wed, 6 Apr 2005 16:44:56 -0400
"Jason Korkin" <jkorkin at korksoft.com> wrote:

> Hi all,
> 
> Having a little performance issue with regards to softgoods downloads.
> 
> We're trying to send our "large" files -- e.g. 70 - 200MB in size but they
> are taking forever to begin streaming as a download.  I am assuming that the
> $Tag->file() is actually loading the entire file into memory before
> streaming the data out...?
> 
> I'm using the following Perl/ITL:
> 
> [perl interpolate=1]
>         my $type = 'application/x-force-download';
>         my $file_loc = "upload/" . $Scratch->{username} . "/" .
> $Scratch->{filename};
>         my $content = $Tag->file("$file_loc");
>         my $length = length($content);
> 
>         if (! $length)  {
>                 $Scratch->{not_found} = "1";
>                 $Document->header("Location: available.html\n\n");
>                 $Document->hot(1);
>                 return;
>         }
> 
>         $Document->header("Content-Disposition: attachment;
> filename=$Scratch->{filename}\nContent-Type: application/x-force-download;
> name=$$
>         $Document->hot(1);
>         $Document->write($content);
>         return;
> [/perl]
> 
> 
> Any ideas on how I can drastically improve performance?

Let Apache handle the download or write a global usertag which
sends out the file in pieces with Perl read functions.

Bye
	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team



More information about the interchange-users mailing list