[ic] problem setting up downloads
Jonathan Clark
jonc at webmaint.com
Tue Jul 29 18:27:20 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
--
Jonathan Clark
Webmaint.com - Building Clever Websites http://www.webmaint.com/
Webmaint.net - Business Web Hosting http://www.webmaint.net/
More information about the interchange-users
mailing list