My Oracle Support Banner

MOD_PLSQL Download Fails With HTTP-500 ORA-22285: Non-Existent Directory Or File For GETLENGTH Operation (Doc ID 754471.1)

Last updated on OCTOBER 04, 2018

Applies to:

Oracle HTTP Server - Version to 10.1.4 [Release 9iAS to AS10gR2]
z*OBSOLETE: Microsoft Windows Server 2003
z*OBSOLETE: Microsoft Windows 2000
z*OBSOLETE: Microsoft Windows XP
Microsoft Windows 2000Microsoft Windows XPMicrosoft Windows Server 2003


Downloading a file with MOD_PLSQL on an Application Server environment on Windows 2003 fails with an ORA-22285 / ORA-22288 error if the file sits in a remote disk, referenced in the PLSQL code using Microsoft Windows UNC syntax (i.e. \\<hostname>\<shared directory>), e.g.:

create or replace directory MY_DIR AS '\\MyRemotePC\mySharedDir';

The following test PLSQL procedure is used as an example:

procedure test1 is
image_name varchar2(100);
mime_type varchar2(100);
f_lob bfile;
bfile_length number;
image_name :='abc.jpg';
mime_type :='image/jpeg';
f_lob := bfilename('MY_DIR', image_name);

bfile_length := dbms_lob.getlength(f_lob);
owa_util.mime_header(mime_type, false);
htp.p('content-length: '||bfile_length);
-- htp.p('content-disposition: attachment; filename="'||image_name||'"');

The problem does not reproduce downloading a file stored in a local file system


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.