Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Uploading file

Re: Uploading file

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Fri, 20 Jun 2003 21:27:35 +0400
Message-ID: <bcvg6e$ih5$1@babylon.agtel.net>


"Upendra Mishra" <upendram_at_teri.res.in> wrote in message news:214aff7.0306192110.4c3cbda1_at_posting.google.com...
> Thanx for replying friedrich
> UTL_FILE package is there in 9i .
> But my problem is bit diferrent i ve to put those files into OS
> directory which user has uploaded through web. Files are being
> uploaded but in database . Now the requirement is to put thoase files
> in os directory.
>

Using UTL_BinFile package (available free at our website) you can do this pretty easily:

  1. The user uploads the file. It gets saved into a BLOB in the upload table by the mod_plsql.
  2. Your upload handler procedure is invoked and passed the name of the file as saved in the NAME column.
  3. In the upload handler procedure you retrieve the newly arrived BLOB by its name and save it to disk using UTL_BinFile.Save_BLOB_To_File(blob, filename).
  4. You delete the row from the upload table and update some other table to record the file location so that it can be accessed from your web application (if needed.)
  5. You commit and return some confirmation page or whatever. :)

The package works in 8i and later provided that the JServer/Oracle VM is operational (it uses some Java to do the work). Read the docs for security-related info and examples (PSP_Mail docs, that is - the package is fully documented there.)

Hope this helps.

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.
Received on Fri Jun 20 2003 - 12:27:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US