[ic] problem setting up downloads
Chris Snow
snowch at care4pcs.com
Wed Jul 30 16:54:29 EDT 2003
> > I am trying to setup some pages for downloading pdf newsletters. The
> > downloads work in mozilla, but not in IE (6). IE just presents a blank
> > page with:
> >
> > <p> </p>
> >
> > Does anyone know how I can resolve this?
> >
> > TIA.
> >
> > Chris
> >
> > ----------- newsletters.html -------------
> > ....
> > <td align="center">
> > [query sql="select sku from products where category = 'newsletter'"
> > type=list
> > more=1
> > ml=10]
> >
> > <br>
> > <br>
> > [list]
> > <A HREF="[area href=download_doc.html
> > form='doc_download=[sql-code]']"
> > target="_NEW" type="application/pdf">[sql-description]</A><BR><BR>
> > [/list]
>
> Can't say I have seen type= in an anchor tag before.. Also, your target
for
> a new window should be _BLANK not _NEW. (which is most likely your
problem).
>
> >
> > [more_list]
> > [more]
> > [/more_list]
> >
> > [/query]
> > </td>
> > ....
> >
> >
> > --------- download_doc.html --------------
> > [perl products]
> > my $type = "application/pdf";
> > my $location = "pages/downloads/" . $CGI->{doc_download} ;
> >
> > my $content = $Tag->file("$location");
> > my $len = length($content);
> > if(! $len) {
> > Log("Not found: $Scratch->{deliverable} type=$type at
> > $location, 404");
> > $Document->header('Status: 404 not found');
> > $Document->hot(1);
> > $Document->write(<<EOF);
> > Sorry, $Scratch->{deliverable} not found.
> > EOF
> > return;
> > }
> > $Document->header("Content-Type: $type\nContent-Length: $len");
> > $Document->hot(1);
> > $Document->write($content);
> > return;
> > [/perl]
>
> Why not use the [file] tag? Here's a code snippet from a download page I
> have used:
>
> [tag op=header interpolate=1]
> Content-type: application/octet-stream
> Content-disposition: inline; filename=[scratch file_name]
> Content-length: [scratch file_size]
> [/tag]
> [file name="upload/docmgt/[cgi instance_id]/[cgi file_id]"]
>
> Jonathan
>
Thanks Jonathan, it worked a treat.
More information about the interchange-users
mailing list