Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> htp.download_file problem
Hi everyone,
I have a really interesting problem with the htp.download_file procedure.
First, the background info: Database is Oracle 8.0.5 running on Solaris, OAS 4.0.7.0.
The procedure using htp.download_file follows:
CREATE OR REPLACE PROCEDURE Down(file_val VARCHAR2) IS
l_ext VARCHAR2(100) := NULL; l_mime_type VARCHAR2(100) := NULL;mime_header VARCHAR2 (100);
l_mime_type := 'application/acrobat'; ELSIF UPPER(l_ext) = '.GIF' THEN
l_mime_type := 'image/gif';
ELSIF UPPER(l_ext) ='.JPG' THEN
l_mime_type := 'image/jpg';
END IF;
IF l_mime_type IS NOT NULL THEN
owa_util.mime_header(l_mime_type);
END IF;
htp.download_file(file_val);
END Down;
/
The idea is that the mime-type will determine how the browser handles the file being downloaded, i.e. if it knows what to do with the file type, such as .gif, handle it, otherwise, ask the user.
When trying to display the files (mostly images), IE5 works ok, but not Netscape. The reason is that htp.download_file seems too be changing the content-type (mime-type) header to "application/octet-stream". This
has been confirmed. In fact, when htp.download_file is commented out, the content-type header is whatever the file's extension is, such as "image/gif". So, in effect htp.download_file is overriding the setting made with "owa_util.mime_header(l_mime_type)" procedure call.
Has anyone seen this or had to deal with something similar?? Any ideas??
Thanks in advance for all the help.
Joel Received on Sat May 27 2000 - 00:00:00 CDT