Home » Developer & Programmer » Application Express & MOD_PLSQL » Upload desktop files (pdf/doc) using PLSQL
icon7.gif  Upload desktop files (pdf/doc) using PLSQL [message #215214] Fri, 19 January 2007 15:57 Go to next message
avk123
Messages: 3
Registered: January 2007
Junior Member
I have a requirement where in my web application users want to upload/attach a file (just like you attach files when sending emails) which is saved on their PC/network folder using a front end screen which has a "Browse" button and clicking on which opens a windows dialog showing respective files and folders on that PC. I then intend to store the file that user selects as a BLOB so that they can download it at a later stage file by clicking on the html link provided on front end (web browser). The web application is coded using plsql.

Users will be mainly uploading and downloading pdf, word or xls documents. I am want to know how do I select the path or the file that user selects and transfer it onto Oracle server and then save it in the Oracle DB as a blob. I am pretty clear as far as the download part goes and the upload piece once the file is on the Oracle server but I am stuck at a point where file is transfered from client PC to a predefined directory on Oracle server when users click "Attach" button.

But please advise as to how to do this using plsql with an example code.

Thank you very much for your time and help.
A.K.
Re: Upload desktop files (pdf/doc) using PLSQL [message #215219 is a reply to message #215214] Fri, 19 January 2007 17:45 Go to previous messageGo to next message
rkamuni
Messages: 2
Registered: November 2006
Location: San Diego
Junior Member
Hi,

Create a browse button as shown below in one page where the users will be able to select the files from the local system.
<INPUT type="file: name="some_name" >
And in the submit event, forward the call to next web pl/sql page.
document.form_name.method="post";
document.form_name.action="/pls/WebDadvalue/submitpkg.proc";
document.form_name.submit();
When you select a file using the browse button in first page and submit it, then the file will be copied to oracle server in to the table defined for that web Dad. It will be stored as BLOB in that table. with file name in one column and path in another column.

In Oracle Applications WEB PL/SQL, the table is fnd_lobs_document.

Thanks,
Ramesh.

[Updated on: Fri, 19 January 2007 17:45]

Report message to a moderator

Re: Upload desktop files (pdf/doc) using PLSQL [message #215224 is a reply to message #215219] Fri, 19 January 2007 22:30 Go to previous messageGo to next message
avk123
Messages: 3
Registered: January 2007
Junior Member
Thanks Ramesh for your prompt response. I have one question, you mentioned that in Oracle applications (which applies to me) the document is stored in FND_LOBS_DOCUMENT, however, do I need to do anything such as default the table name in DAD configuration or is that the default?

I read a few posts which talked about taking DBA's help to set DAD parameters. However, I am using Oracle Application's (which is used by standard Oracle application modules) DAD to open my web pages. Also, like you suggested when I passed the file name (selected from the 1st page using the browse button) to next web plsql page and displayed that the file parameter name value on the next page, it showed something like "F13245/demo.pdf" where "demo.pdf" was the file I had attached from my C:\ drive. Does it signify anything? Please send me the code with any examples.
Thanks much for your time,
AK
Re: Upload desktop files (pdf/doc) using PLSQL [message #215230 is a reply to message #215224] Fri, 19 January 2007 23:22 Go to previous messageGo to next message
rkamuni
Messages: 2
Registered: November 2006
Location: San Diego
Junior Member
If you are using Oracle Applications, No need to set anything. it is the default set up. This functionality is used in Oracle apps attachment functinality. After submitting the file, Check for the new entry in FND_LOB_DOCUMENT table. The file will be stored as BLOB in that table.

Thanks,
Ramesh.K
Re: Upload desktop files (pdf/doc) using PLSQL [message #215347 is a reply to message #215214] Sun, 21 January 2007 12:51 Go to previous messageGo to next message
avk123
Messages: 3
Registered: January 2007
Junior Member
You were right. I checked FND_LOBS_DOCUMENT table and found all my documents that I had uploaded for testing purposes till date. Now I can just read the Blob column from that table to download that file for the end user. Thank you very much. I had posted this question in several different forums and only you could answer it.

I want to know one last thing, let me explain what I want to do:
end users will be uploading pdf/doc files from their individual desktops at different times (which will then be stored in FND_LOBS_DOCUMENT), however, their supervisors will need to see that file i.e. download using the web application. I got hold of a download routine which uses "wpc_docload" built in package, however, how will I associate that document with that particular end user I could have used the time of upload, however, there might be more than one users attaching their respective documents at the same time using their own logins and same web application. FND_LOBS_DOCUMENT table doesn't have a primary key or anything of that sort nor can I store the userid/session id (all it has is "F17952/demo1.pdf" in the name table) in that table as it is a system table. Any ideas would be appreciated.

Also querying from that table without any where condition took me a while and I see it as a performance problem when about 100 - 200 users will start uploading or downloading their documents. Can I speed it up the download process?

Thanks much,
A.K.


Re: Upload desktop files (pdf/doc) using PLSQL [message #240766 is a reply to message #215214] Fri, 25 May 2007 12:35 Go to previous messageGo to next message
mearaj.accounts
Messages: 3
Registered: May 2007
Junior Member
Hi
this is my first post in this forum, actually i have registered because i am facing the same issue asked her

i am new in application express, and i couldn't follow up with all what rkamuni have written, could you please go into a detailed steps

and is it mandatory to store attached files in the FND_LOBS_DOCUMENT table, isn't it better to store them on my own table so i can link it to other tables using my own indexes?

how can i put a link in other pages to allow end user to download the files?

finally, is it possible to show the images in the web page body? i can assume that a query can distinguish images using there extensions, but how can i display them on application express form

Re: Upload desktop files (pdf/doc) using PLSQL [message #240783 is a reply to message #240766] Fri, 25 May 2007 15:13 Go to previous messageGo to next message
andrew again
Messages: 2574
Registered: March 2000
Senior Member
Oracle Applications and Application Express are 2 very different things. The former is a bought application - Apex is a development tool.
http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32469/up_dn_files.htm

Apex uses one table for attachments, but each application has it's own area to keep them separate. Having said that - it's not a perfect solution because you don't have control over storage space for each app and exporting at the database level still gives you the whole table.

See apex forum for displaying images.
http://forums.oracle.com/forums/forum.jspa?forumID=137


You can also just store files using WEBDAV.
http://inside-apex.blogspot.com/2007/01/apexlib-get-page-flow-diagram-of-your.html


icon14.gif  Re: Upload desktop files (pdf/doc) using PLSQL [message #241179 is a reply to message #215214] Mon, 28 May 2007 11:08 Go to previous messageGo to next message
mearaj.accounts
Messages: 3
Registered: May 2007
Junior Member
Thanks
Re: Upload desktop files (pdf/doc) using PLSQL [message #592953 is a reply to message #215219] Tue, 13 August 2013 04:56 Go to previous message
rishi_3382
Messages: 1
Registered: August 2013
Junior Member
I am new to web application, can you please advise on what is the content of this package /pls/WebDadvalue/submitpkg.proc
Previous Topic: Business small commercial app using Apex
Next Topic: apex.oracle.com Few page types missing in new sample app
Goto Forum:
  


Current Time: Mon Sep 01 15:28:59 CDT 2014

Total time taken to generate the page: 0.12811 seconds