Uploading and downloading blobs without wwv_flow_files
Hi,
I am currently working on oracle 10g database and application express.
i went throu the material to upload and download images, pdf from a htmldb book.
it was excellent material. but the book only gave example about loading and downloading images, pdf through flows_files.wwv_flow_files view.
it seemed like we can only d/l the pdf, images and display on htmldb report only throu flows_files.wwv_flow_files view, as in the case of the script below
select
wff.id, htf.anchor( 'p?n=' || wff.id, wff.filename ) filename_1,
wff.filename filename_2, ed.abstract abstract
from
wwv_flow_files wff, easy_document ed
where
wff.name = ed.name;but is there a way to load and download images, pdfs from my own tables without the involvement of flows_files schema.
if then how can i modify the above code to get the pdf from the following table
TableA (vessel number, cruise number, pdf blob)
here for every (vessel, cruise) combination there is a pdf.
how can i get this pdf displayed in my htmldb report.
Can someone guide me please.
Thanks,
Philip.
Hi,
I tried the document link you gave and it looks like, i can directly download pdfs from my own tables without needding to upload to wwv_flow_files_objecst$ table.
i modified the procedure in the document accroding to my requirements and it worked.
in my page i show a grid with the parameters and the pdf documentname as download link.
when i click on the link a popup window with the option to save or open comes up.
but the popup window shows the filename as my procedure name through which i pass the id for the pdf document instaed of the filename which is shown as download link on the page.
How can i change this popup window filename to the default file name shown in the download link.
so that everytime i select the parameters, the page shows the pdf filename as link and on clicking the link the popup window should be able to show the same name shown as link.
i think this can be set either at the procedure level or at the page level.
and this is the following contents of the procedure
-- SET UP HTTP HEADER
-- use an NVL around the mime type and
-- if it is a null set it to application/octect
-- application/octect may launch a download window from windows
owa_util.mime_header( nvl('PDF','application/octet'), FALSE );
-- set the size so the browser knows how much to download
htp.p('Content-length: ' || B_LEN);
-- the filename will be used by the browser if the users does a save as
-- htp.p('Content-Disposition: attachment; filename="'||'CR'||VES||CRU||'.PDF'|| '"');
-- close the headers
owa_util.http_header_close;
-- download the BLOB
wpg_docload.download_file( BREP );and this is what i did at the page level. for that particular column i went to link option and the foll is what i gave:
Link Text: CR#VESSEL##CRUISE#.PDF
Link Attributes: target="_blank"
URL: #OWNER#.PROC_DOWNLOAD_PDFS?V=#VESSEL#&C=#CRUISE#
Here the link text is the filename that i wanted to show when saving the file.
Can someone guid eme please.
Thanks,
Philip.
Similar Messages
-
How to upload and download in BLOB?
I tried webutil but is not working properly according to my needs is there any other way to upload and download files in BLOB?
If any body knows solution please tell me.
Regards,Dear Colleague,
In my Forms application, I use the WEBUTIL to load files into a BLOB column. However, prior to getting WEBUTIL to work, I loaded files into the BLOB column using the following PL/SQL code.
Note, that the example assumes that the row already exists in the table and you are updating it by loading the file into the BLOB. You will also be required to first create a Database Directory object (in my case, it was called "RKMS_DOC_DIR")
I do not have an example for downloading, as I use the WEBUTIL functionality for this.
Good luck!
Randy
PL/SQL (DBMS_LOB Package): Loading an Internal Persistent BLOB
with BFILE Data
The following example illustrates:
How to use LOADBLOBFROMFILE to load the entire file without getting its length first.
How to use the return value of the offsets to calculate the actual amount loaded.
DECLARE
src_loc BFILE := bfilename('RKMS_DOC_DIR','ROPE_Offerte_v2.pdf') ;
v_author VARCHAR2(10) := 'RKMS_MGR' ;
dst_loc BLOB;
src_offset NUMBER := 1;
dst_offset NUMBER := 1;
src_osin NUMBER;
dst_osin NUMBER;
bytes_rd NUMBER;
bytes_wt NUMBER;
BEGIN
-- SELECT ad_composite INTO dst_loc FROM Print_media
-- WHERE product_id=3106 and ad_id=13001 FOR UPDATE;
SELECT doc INTO dst_loc FROM docs
WHERE USER_AUTHOR_ID = v_author FOR UPDATE;
/* Opening the source BFILE is mandatory */
dbms_lob.fileopen(src_loc, dbms_lob.file_readonly);
/* Opening the LOB is optional */
dbms_lob.OPEN(dst_loc, dbms_lob.lob_readwrite);
/* Save the input source/destination offsets */
src_osin := src_offset;
dst_osin := dst_offset;
/* Use LOBMAXSIZE to indicate loading the entire BFILE */
dbms_lob.LOADBLOBFROMFILE(dst_loc, src_loc, dbms_lob.lobmaxsize, src_offset, dst_offset) ;
/* Closing the LOB is mandatory if you have opened it */
dbms_lob.close(dst_loc);
dbms_lob.filecloseall();
COMMIT;
/* Use the src_offset returned to calculate the actual amount read from the BFILE */
bytes_rd := src_offset - src_osin;
dbms_output.put_line(' Number of bytes read from the BFILE ' || bytes_rd ) ;
/* Use the dst_offset returned to calculate the actual amount written to the BLOB */
bytes_wt := dst_offset - dst_osin;
dbms_output.put_line(' Number of bytes written to the BLOB ' || bytes_wt ) ;
/* If there is no exception the number of bytes read should equal to the number of bytes written */
END ;
/ -
About "Upload and download files from ADF into blob type colum."
hi
Using JDeveloper 10.1.3.3.0 I have tried the example available for download from this blog post by Jakub Pawlowski:
"Upload and download files from ADF into blob type colum."
at http://kuba.zilp.pl/?id=1
First a thank you to Jakub for this interesting example.
I have a question about a PDF file that I uploaded using the example.
The file has a size of 10445518 bytes.
After I upload that file, the blob column has a value with a size of 10445516 bytes, 2 bytes less.
SQL> select file_name, dbms_lob.getlength(stored_file) from blob_table;
FILE_NAME
DBMS_LOB.GETLENGTH(STORED_FILE)
ADF-DeveloperGuide-4GL-B25947_01.pdf
10445516If I download that file using the example, it has the same size as the blob value, 10445516 bytes.
If I open the downloaded file, using Adobe Reader 8.1.1, it first shows this message:
"The file is damaged but is being repaired."
After that, there is not problem using the PDF file in Adobe Reader.
I have tried this with both Internet Explorer 6 and Firefox 2.0.0.11.
I have also tried this with other (smaller) files, and those upload and download correctly.
question:
Why are those 2 bytes lost during upload?
many thanks
Jan VerveckenHi!
I can only post you my code that works for me and as I said I had same problems but can't remember what solved them. My code:
public void fileUploaded(ValueChangeEvent event)
FacesContext fc = FacesContext.getCurrentInstance();
UploadedFile file = (UploadedFile) event.getNewValue();
if (file != null && file.getLength() > 0)
// here I have some messages written and a call to the method on AM to save the uploaded file to the DB
private BlobDomain newBlobDomainForInputStream(InputStream in)
throws SQLException, IOException
BlobDomain loBlob = new BlobDomain();
OutputStream out = loBlob.getBinaryOutputStream();
writeInputStreamToWriter(in, out);
in.close();
out.close();
return loBlob;
private static void writeInputStreamToWriter(InputStream in,
OutputStream out)
throws IOException
byte[] buffer = new byte[8192];
int charsRead = 0;
while ((charsRead = in.read(buffer, 0, 8192)) != -1)
out.write(buffer, 0, charsRead);
* Launch the upload - see fileUploaded() for actual upload handling.
* @return null navigation event - we stay on this page
public String UploadButton_action()
if (this.getMyInputFile().getValue() == null)
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage message =
new FacesMessage(FacesMessage.SEVERITY_WARN, JSFUtils.getStringFromBundle("fileupload.emptyfielderror"),
null);
context.addMessage(this.getMyInputFile().getId(), message);
return null;
* Setter for inputFile UI Component.
* @param inputFile inputFile UI component
public void setMyInputFile(CoreInputFile inputFile)
this.myInputFile = inputFile;
* Getter for inputFile UI Component.
* @return inputFile UI component
public CoreInputFile getMyInputFile()
return myInputFile;
}fileUploaded is a valueChangeListener on inputFile and UploadButton_action is as the name says the action for upload button.
Hope this helps. If not, than your problem is probably not the same as mine was, although the message about file corrupted was the same.
Next thing you can check in this case is if your file exceeds max file upload size. I don't know the exact default value, but if the file is too long I think this upload logic will upload only a part of the file and save it to the DB which can also lead to the same file corrupted error.
You can set the max upload value in web.xml like this:
<context-param>
<!-- Maximum memory per request (in bytes) -->
<param-name>oracle.adf.view.faces.UPLOAD_MAX_MEMORY</param-name>
<!-- Use 5000K -->
<param-value>5120000</param-value>
</context-param>
<context-param>
<!-- Maximum disk space per request (in bytes) -->
<param-name>oracle.adf.view.faces.UPLOAD_MAX_DISK_SPACE</param-name>
<!-- Use 10,000K -->
<param-value>15360000</param-value>
</context-param> -
Upload and download files from ADF 11g into blob type colum
Hi Guys ,
Anybody help me how to upload and download the *.pdf / *.doc file in blob object in ADF 11G.
Thanks ,
Ashwani YadavYou should try the JDeveloper and ADF forum. This is the Oracle FORMS forum.
Craig... -
Uploading and downloading files from a web app (Urgent!!)
Hi everyone:
I'm developing an application in PL/SQL to upload and download files from an HTML webpage. I congured the document table and the parameters necessary in the DAD of my application.
when I upload the file using my webpage that file info is automatically uploaded to the doc table. This is as far as I have gotten.
I need to do the following:
- Place the uploaded file into a column in another table in my database as part of a text message (think of it as an email message), and delete the file from the doc table (as this is thought to be a temp table that holds the file when uploaded from my webpage)
- Retreive the file so that it can be downloaded from another web page.
The file can be a PDF, WORD DOC, etc...
I now that I can do this with InterMedia but I haven't figured out how :(
Can anyone please point me to an example or some documentation that can guide me through the process.
DB VERSION: 8.1.7
IAS VERSION: 1.0.2.2
Thanks,
Carlos AbarcaThe idea was for you to look at the code and get an idea of how to access the BLOB in the document table. IF you look at the procedure
insert_new_photo( new_description IN VARCHAR2,
new_location IN VARCHAR,
new_photo IN VARCHAR2 )
It shows how to access the blob that is stored in the document table. You can then copy this blob to your own table using the DBMS_LOB package.
Hope this helps,
Larry -
Using CSA to filter MSN Messenger file upload and download
How would i go about filtering out the file upload and download functionality in messenger ?
I've already disallowed the possibility of uploading or saving from Messenger by not allowing the program the read or write files. But when a PC without this policy on it uploads to a CSA protected host. The CSA will download the entire file but then refuse to save the file.
I'd rather disallow this functionality alltogether ? my guess are that i would hae to do some COM filtering ?
I'd be greatfull for any hints you might have.
Best Regards,
LasseThe document Blocking Peer-to-Peer File Sharing Programs with the PIX Firewall has more information on blocking file sharing applications.
http://www.cisco.com/en/US/tech/tk583/tk372/technologies_tech_note09186a00801e419a.shtml -
Apex application file -upload and download a file.
hi
im having an issue with an application i created,its about uploading and downloading a file in application.the application is working and was able to upload and download a file but i have not idea there the file is stored in the application database,try to search for the file,its something dealing with the apex_application_file and i cant find it.
Any idea where the file is stored?
thnx
niveshDear nivesh!
If you upload a file into an APEX application the file is temporarily stored in the APEX_APPLICATION_FILES table. If you close your current application page the APEX_APPLICATION_FILES table will be cleared. You should create your own table to store files in a BLOB column. I've create an example for uploading images into an APEX application on apex.oracle.com. If you want to have a look at it please use the following credentials:
Workspace: flo_demo
Username: dev_null
Password: password
Application: 61811
Yours sincerely
Florian W. -
ANN: Complete File Upload and Download Power For Dreamweaver
WebAssist is proud to announce the availability of Digital
File Pro, an
extension for Dreamweaver that brings complete upload and
download
functionality to ASP, ColdFusion and PHP without
server-side components.
Digital File Pro is now available for $79.99 until September
19, 2006
(regular price, $99.99). Owners of eCommerce Suite, Super
Suite or Admin
Suite from WebAssist can upgrade for only $49.99.
For more information, visit:
http://webassist.com/professional/products/productdetails.asp?PID=112&CouponID=0x62xd
enthusiastically,
mark haynes
webassist sales
Check out our Special Offers at:
http://www.webassist.com/professional/products/specials.aspMark:
Were you aware your page
http://webassist.com/professional/products/productdetails.asp?PID=112&CouponID=0x62xd)
doesn't render correctly in IE BETA 7 (text cut off on the
right)?
Don't know if you knew (or even care since it IS a beta) but
I thought I'd
let you know.
Rick in Tacoma -
Tracking file upload and download details
Hi All,
We are using TMG in our place,all users/servers are used to connect the internet with TMG server..
is there a way to track the information of file upload and download details in TMG..
KJSUBBUHi,
Please check the blog below. I haven't try it.
Live monitor for TMG server
Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee
the accuracy of this third-party contact information.
Best Regards,
Joyce
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
File Upload and Download in Oracle iAS PL/SQL Gateway
i'm using the example 113471.1 to "File Upload and Download in
Oracle iAS PL/SQL Gateway"
when i press the submit button after i select a file to upload
i get the next message in the browser "No se puede mostrar la
pagina" HTTP 404 file not found.
I think the problem is in ctnsample.upload_form in the line
htp.formOpen(curl => 'cntsample.upload', cmethod => 'POST',
cenctype => 'multipart/form-data');
The ctnsample.remove work fine.
Could you,help me...There is a document in the Oracle 9iAS 1.0.2.2 Library titled "Using the PL-SQL Gateway" Part Number A90099-01.pdf that explains file upload and download through modplsql. In particular there is a section there titled "Direct BLOB Download" which explains how one can easily download a blob utilising the wpg_docload package.
I am still concerned that there exist duplicate copies of my blob content. One copy in the wwdoc_document$ table, and one in my custom table.
Dmitry/Oracle can you confirm this? -
Uploading and Downloading files in an Applicaiton
I was able to successfully upload and download files stored in the database through Application Express by following the how to instructions at -->
http://download-uk.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CJAHDJDA
QUESTION: Is it possible to retrieve the downloaded file without granting execute to the download procedure? My DBA is requesting that I remove the procedures public grant, but when I do, I can no longer download the file.As long as the Oracle username with the connection has 'execute' on the package 'public' should not need execute. Though I do not use the tools in question so there may be factors I am unaware of, but Oracle wise the connected session needs execute. If can get it from public, a role, or a direct grant. I just say use role based grants or direct grants rather than a public grant to get the privilege.
HTH -- Mark D Powell -- -
Upload and download from database
i need to do a form to upload data in a blob field in the database and then have a link or smth simliar to download them..... any link or example wich can help me plss??? thanks in advance
Hi Shay! i am not finding nothing about upload and download in a blob field in database ... in the link you sent me ... can you be more specific pls? thanks :=)
-
Upload and Download through the same button toolbar Spreadsheet
Hello,
Does anyone know if I can set up the two processes: Uploading and downloading Data Inside the Excel toolbar?
Web ADI defines the Oracle tap where the Upload and Download options are. Where Web ADI defines the Oracle tap?
Can I modify that menu and unify in the same button the upload and download processes.
My client wants to see the refreshed data inside Oracle without pushing Uploading Data and pushing again Downloading Data.
Thanks in advance,
Carmen.Duplicate as this thread:
Upload and Download through same Excel Sheet
//Nitin -
Use WEBUTIL for upload and download file to/from Database
Dear friends
I have a table with three columns (id , name , myDoc) myDoc is a BLOB, I would like upload word documents or PDFs or images to myDoc column, I use Oracle Form 10g, I try to use webutil to solve my problem, but I couldn't, Please help me.
Thanks# Details
# transfer.database.enabled : Can be TRUE or FALSE - allows you to disable
# upload and download from the database server.
# transfer.appsrv.enabled : Can be TRUE or FALSE - allows you to disable
# upload and download from the application
# server.
# transfer.appsrv.workAreaRoot: The root of the location in which WebUtil can
# store temporary files uploaded from the client.
# If no location is specified, Application Server
# user_home/temp will be assumed.
# This location is always readable and writable
# no matter what the settings in
# transfer.appsrv.* are. This setting is
# required if you need the Client side
# READ/WRITE_IMAGE_FILE procedures.
# transfer.appsrv.accessControl:Can be TRUE or FALSE - allows you to indicate
# that uploads and downloads can only occur from
# the directories named in the
# transfer.appsrv.read.n and
# transfer.appsrv.write.n entries and their
# subdirectories. If this setting is FALSE,
# transfers can happen anywhere.
# transfer.appsrv.read.<n>: List of directory names that downloads can read
# from.
# transfer.appsrv.write.<n>: List of directory names that uploads can write
# to.
#NOTE: By default the file transfer is disabled as a security measure
transfer.database.enabled=true
transfer.appsrv.enabled=true
transfer.appsrv.workAreaRoot=
transfer.appsrv.accessControl=TRUE
#List transfer.appsrv.read.<n> directories
transfer.appsrv.read.1=c:\temp
#List transfer.appsrv.write.<n> directories
transfer.appsrv.write.1=c:\temp -
How to upload and Download the file in a system through java programing
I am trying to upload a file as well as want to download the uploaded file in my system....I don't have any server an all.
I want to implement this in my system only .
I got this code but i don't know ,where i have to make the change and what are the parameters i have to pass.
can any one help me on this code ....please
here some piece of code
File Upload and Download Code Example
package com.resource.util;
public class FileUpload
public void upload( String ftpServer, String user, String password,
String fileName, File source ) throws MalformedURLException,
IOException
if (ftpServer != null && fileName != null && source != null)
StringBuffer sb = new StringBuffer( "ftp://" );
// check for authentication else assume its anonymous access.
if (user != null && password != null)
sb.append( user );
sb.append( ':' );
sb.append( password );
sb.append( '@' );
sb.append( ftpServer );
sb.append( '/' );
sb.append( fileName );
* type ==> a=ASCII mode, i=image (binary) mode, d= file directory
* listing
sb.append( ";type=i" );
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try
URL url = new URL( sb.toString() );
URLConnection urlc = url.openConnection();
bos = new BufferedOutputStream( urlc.getOutputStream() );
bis = new BufferedInputStream( new FileInputStream( source ) );
int i;
// read byte by byte until end of stream
while ((i = bis.read()) != -1)
bos.write( i );
finally
if (bis != null)
try
bis.close();
catch (IOException ioe)
ioe.printStackTrace();
if (bos != null)
try
bos.close();
catch (IOException ioe)
ioe.printStackTrace();
else
System.out.println( "Input not available." );
}At least that is what the code you posted suggests to me.It looks like that to me too.
I believe that
URLConnection urlc = url.openConnection(url);Will return you an FTP URLConnection implementation if you pass it a ftp:// url
So for simple FTP ops, you don't need any external libs.
Actually, looking at your code, this is already what you are doing, so I really don't get this:
am not using FTP server..... i want to implement in my system only ....So How i will do.
Can you give me any idea based on this code Can you explain a bit more what you need?
patumaire
Maybe you are looking for
-
I was having a bit of difficultly in getting crop settings to properly sync in Lightroom 5.7.1 (running on OS X 10.10.1) when Constrain to Warp was checked. This appears to be a bug in the latest version(s) of Lightroom that include(s) the GoPro Her
-
I purchased a frist gen. iPad from a friend. I find that it's using 5.1.1. and says that it's "updated" when I check. Problem came when I tried to download my Netflix onto the ipad. I keep getting the prompt that I must upgrade to iOS 6. The netf
-
How to run a batch file from within an Oracle 9i Form?
Hi, I would like to execute a batch file from within an oracle form - I'm assuming there's some PLSQL command I can use? I am not allowed to use any third party libraries, and I'm hoping I can get away without having to progam any C or Java to do it.
-
Address Book pic not used for Buddy Icon
Hi there, The buddy icon for everyone I chat with is a default blue globe . . . I know these people, my brother for example, have a photo selected for themselves in their address book. Why is there address book photo not appearing as their buddy icon
-
How to broadcast a new email address to multiple friends/contacts?
I have a friend who's running Leopard and has just gotten a new email address. What's the best way to send out an email announcing the new email address?We don't want to have to go through previous recipients or the Address Book one at a time. Than