34MCA2K2 wrote:Yes it is possible. Samba on Unix sharing the directory containing the file. NFS on the Unix server sharing the directory containing the file. FTP server on Unix allowing the file to be read and copied. OpenSSH on the Unix allowing the file to be read and copied via scp (secure copy).
Is there a way to transfer file from UNIX server(Oracle database), to Windows server? All I know if Windows path. I am able to read the file as it is on server, however it does not recognize Windows directory at all.
On Windows, IE can be used interactively to copy the file across. For automation (via PowerShell or console jobs), use a command like tool like wget* to download the file.
--// URL example: http://my-server.my-domain.com/MyDAD/MySchemaName.StreamFile?fileID=1234 create or replace procedure StreamFile( fileID number ) AUTHID DEFINER is mimeType varchar2(48); fileName varchar2(400); lobContent BLOB; begin --// read the LOB from a table (this example uses the --// Apex file uploads table - change it to your own files table) select f.filename, f.mime_type, f.blob_content into fileName, mimeType, lobContent from FLOWS_FILES.WWV_FLOW_FILE_OBJECTS$ f where f.id = fileID; --// format a basic HTTP header that describes the file stream send OWA_UTIL.mime_header( mimeType, FALSE ); -- e.g. text/csv text/plain text/html image/gif HTP.p( 'Content-Disposition: attachment; filename='||fileName ); HTP.p( 'Content-Length: ' || DBMS_LOB.GetLength(lobContent) ); OWA_UTIL.http_header_close; --// now write the BLOB as a mime stream using the Web Procedural Gateway's --// doc load API WPG_DOCLOAD.download_file( lobContent ); exception when OTHERS then --// Decide what HTML to generate (if at all) if there is a failure --// (usually not a good idea to show database errors to the --// web browser client as that can provide technical details --// that could be useful for exploiting the database) HTP.prn( 'StreamFile() failed with '||SQLERRM(SQLCODE) ); end; /
Billy Verreynne wrote:Glad to see two Oracle Aces answering my question. Thanks a ton to both of you!
But seeing as this is an Oracle database forum (not an operating system forum), and the subject matter is the database server languages SQL and PL/SQL, here is a PL/SQL solution.
Create a table using the BFILE data type for referencing the files on the Unix o/s. Provide a web enabled procedure for downloading the files via HTTP using a web browser. This procedure will look something as follows: