Re: Uploading file
Date: Fri, 20 Jun 2003 21:27:35 +0400
Message-ID: <bcvg6e$ih5$1_at_babylon.agtel.net>
[Quoted] "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:
- The user uploads the file. It gets saved into a BLOB in the upload table by the mod_plsql.
- Your upload handler procedure is invoked and passed the name of the file as saved in the NAME column.
- 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).
- 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.)
- 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_at_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 - 19:27:35 CEST
