in reply to How to offer binary files for download via CGI ?
The sample code you've posted doesn't do anything with the file's contents; it just reads them, puts them in a variable, then returns it as the result of dl_user. Perhaps it's printed elsewhere, but if not that's part of your problem.
The usual content type for arbitrary binary data is application/octet-stream, although I don't think that's part of your current problem.
It can also be awkward to read binary files with the diamond operator <FILE>, since line breaks don't occur in any particular place. It's usually best to use read, but again I don't think this is causing the problem you're seeing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to offer binary files for download via CGI ?
by waswas-fng (Curate) on Jul 22, 2003 at 23:53 UTC |