To upload and download
i hv 2 buttons one for upload and another for download
through webutil
i hv written this code but it is not inserting record into the table, thr r no records in the table, it is empty, when i try to upload .txt file it is showing me an error "missing expression" ORA-00936
the code is
declare
sMY_file varchar2(200);
v_Last_Directory Varchar2(2000);
v_Upload_Succes boolean;
nWHERE number(10);
OUT_DOC_ID number;
temp_id number;
doc_id_temp number;
v_status VARCHAR2(200);
BEGIN
OUT_DOC_ID:=:parameter.p_dealid; --:files.deal_id;
sMY_file := WebUtil_File.File_save_Dialog(v_Last_Directory,
'test',
'|All Files|*.*|',
'Select a file');
if OUT_DOC_ID is not null then
v_Upload_Succes := WebUtil_File_Transfer.Client_to_db(sMY_file,
'deal_document_file', -- TABLE name
'CONTENT' , -- columname
'deal_id||='||OUT_DOC_ID ||' and document_file_name='||:files.document_file_name -- where
elsif OUT_DOC_ID is null then
v_status := get_block_property('files',status);
temp_id:=get_id;
:files.deal_id:=temp_id;
:files.document_file_name:= substr(sMY_file,instr(sMY_file,'\',-1)+1);
insert into deal_document_file (deal_id,document_file_name) values
(:files.deal_id, :files.document_file_name);
commit;
v_Upload_Succes := WebUtil_File_Transfer.Client_to_db( sMY_file,
'deal_document_file', -- TABLE name
'CONTENT' , -- columname
'deal_id='||:files.deal_id||' and document_file_name='||:files.document_file_name
end if;
commit;
if (v_Upload_Succes) then
:files.maker:= sysuser;
:files.made_at:=sysdate;
end if;
end;
commit;
could anybody help me in this.
No, the form is not fine else you would not have this FRM error message.
Check the syntax of the parameters given to the WebUtil_File_Transfer.Client_to_db() Webutil function. add a message() instruction just after to see if the function if well executed.
Francois
Similar Messages
-
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 -
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 -
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. -
Upload and download a PDF in BSP
Hi All,
I need to do the following funtionalityin BSP (business server page ).
1)upload and download a PDF
Pls anyone help me by providing the necessary code to do this .
Thanks in Advance
RizwanHi,
This link is useful for U
http://help.sap.com/saphelp_nw04/helpdata/en/eb/8c683c8de8a969e10000000a114084/content.htm
http://wiki.sdn.sap.com/wiki/display/BSP/HandlingBinaryData
Regards
kk -
File upload and download through web Dynpro2.0.9.
Hai All,
File upload and download through web Dynpro "IWDResource" package is used.But in web Dynpro 2.0.9. this package is not possible.How to uplolad and download files through web Dynpro2.0.9.
Anyone can help me?
Thanks in Advance,
Kindly Regards,
K.Saravanan.Hi Saravanan,
You can go through these links,
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/63/9c0e41a346ef6fe10000000a1550b0/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/63/9c0e41a346ef6fe10000000a1550b0/frameset.htm</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/5a/90ff4cd0c8cd48a69b836e5e550880/frameset.htm</a>
So, apart from putting FileUpload UI on your view, you have to implement a method which will do the actual uplod for you.
Hope this helps.
Regards,
Mausam -
How to upload and download a file in server side program
Give me a sample code for the file upload and download using Server side program.
You should try one of these forums for an answer to your question:
http://swforum.sun.com/jive/forum.jspa?forumID=116
http://community.java.net/netbeans
http://linux.java.net -
How to upload and download a files into AL11 directory in ABAP
Hi,
How to upload and download a files into AL11 directory in ABAP
thanks
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Mar 21, 2011 9:18 AMYou should try one of these forums for an answer to your question:
http://swforum.sun.com/jive/forum.jspa?forumID=116
http://community.java.net/netbeans
http://linux.java.net -
How to solve Fusion ADF file upload and download?
Now we are building web application with Fusion ADF (JDeveloper 11.1.2.0.0). We want to downloading and uploading from tables.Is there any special tool in Fusion ADF or should I going with traditional java coding. Thanks
Actually ADF Provide Components for file upload and download
Download :
<af:fileDownloadActionListener/>
See tagDoc: http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_fileDownloadActionListener.html
Upload
<af:inputFile/>
See tagDoc: http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_inputFile.html
Edited by: -CHS on Jul 6, 2011 9:52 AM -
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 ;
/ -
photostram has stopped working between iphone and pc, uploading and downloading. I have gone through all the setups, made sure everthing is on but still no luck. Any ideas??
Frank-
Thanks for the suggestion -- I hadn't tried that but just did and it still doesn't seem to work. Would the binding cache AttrDefs separately from results? -
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 -
Please help me on file upload and download
Dear all..
i am new in this i try to apply the tutorial for file upload and download but it is old i work on net weaver 7.1 and many proery has change and i cant applyb this tutorial...Thanks. If you can provide some more details about where - some application, or a web page - are you trying to upload or download a file we can discover to documentation you need. Also, it will be of help if you tell what is the name of the outdated guide you mentioned.
Best regards,
Rossen -
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 -
Reg :File upload and download from client machine
hi..
anyone help me the way that how to upload and download word
document file from client machine.. i am using j2eeserver1.4 in linux..
i want upload file from client machine(windows) to server(linux.) please
help me . tell me idea regarding..
i have tried this coding.. but i can transfer txt file. only. when i upload mirosoft word file.. it will open with some ascii values with actual content.
<!-- upload.jsp -->
<%@ page import="java.io.*" %>
<%String contentType = request.getContentType();
String file = "";
String saveFile = "";
FileOutputStream fileOut = null;
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength)
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
try {
file = new String(dataBytes);
saveFile = file.substring(file.indexOf("filename=\"") + 10);
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
saveFile = saveFile.substring(saveFile.lastIndexOf("/") + 1,saveFile.indexOf("\""));
int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1,contentType.length());
int pos;
pos = file.indexOf("filename=/" + 1);
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
String folder = "/tmp/uploads/";
fileOut = new FileOutputStream(folder + saveFile);
fileOut.write(dataBytes);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush(); } catch(Exception e) { out.print(e);
} finally
{ try
{fileOut.close();
}catch(Exception err)
%>
please which package will help me to upload word document file with no errror. send me how can use in ftp.. send me some sample program..
Regards..
New User M.Senthil..Hi,
Well,i don't know whether if this helps people here are not.
It is always a good practise to do it via Servlet and then download content.
The adavantage of doing this is
1). You may not need to pack the downloadable with the .war which you ultimately genrate which ceratinly help us in terms of faster deployment.
3). You may update the new content just by moving a file to the backup folder.
2).One may definately download the content irrespective to the content/file.
Hope example below helps..
Configurations:
In the above example we are assuming that we placing all downlodable file in D:/webapp/downlodables/ and you have configured the same path as a init param with the name "filePath" in your web.xml.
something like the one below.
<servlet>
<servlet-name>DownloadServlet</servlet-name>
<servlet-class>com.DownloadServlet</servlet-class>
<init-param>
<param-name>filePath</param-name>
<param-value>D:/webapp/downlodables/</param-name>
<!--Could use any backup folder Available on your Server-->
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DownloadServlet</servlet-name>
<url-pattern>/downloadFile</url-pattern>
</servlet-mapping>DownloadServlet.java:
==================
package com;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.activation.MimetypesFileTypeMap;
*@Author RaHuL
/**Download Servlet
* which could be accessed downloadFile?fid=fileName
* or
* http://HOST_NAME:APPLN_PORT/ApplnContext/downloadFile?fid=fileName
public class DownloadServlet extends HttpServlet{
private static String filePath = new String();
private static boolean dirExists = false;
public void init(ServletConfig config){
// Acquiring Backup Folder Part
filePath = config.getInitParameter("filePath");
dirExists = new File(filePath).exists();
private void processAction(HttpServletRequest request,HttpServletResponse response) throws Exception{
// Some Authentication Checks depending upon requirements.
// getting fileName which user is requesting for
String fileName = request.getParameter("fid");
//Building the filePath
StringBuffer tFile = new StringBuffer();
tFile.append(filePath);
tFile.append("fileName");
boolean exists = new File(tFile.toString()).exists();
// Checking whether the file Exists or not
if(exists){
FileInputStream input = null;
BufferedOutputStream output = null;
int contentLength = 0;
try{
// Getting the Mime-Type
String contentType = new MimetypesFileTypeMap().getContentType(tFile.toString());
input = new FileInputStream(tFile.toString());
contentLength = input.available();
response.setContentType(contentType);
response.setContentLength(contentLength);
response.setHeader("Content-Disposition","attachment;filename="+fileName);
output = new BufferedOutputStream(response.getOutputStream());
while ( contentLength-- > 0 ) {
output.write(input.read());
output.flush();
}catch(IOException e) {
System.err.println("Exception Occured:"+e.getMessage());
System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
} finally {
if (output != null) {
try {
output.close();
} catch (IOException ie) {
System.err.println("Exception Occured:"+e.getMessage());
System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
}else{
response.sendRedirect("/errorPage.html");
public void doPost(HttpServletRequest request,HttpServletResponse response) throws Exception{
processAction(request,response);
public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
processAction(request,response);
NOTE: Make sure You include activations.jar in your CLASSPATH b4 trying the code.
therefore,if you have something like above set as your application enviroment in the above disccussed
can be done by just giving a simple hyper link like
<a href="downloadFile?fid=fileName.qxd" target="_blank">Download File</a>REGARDS,
RaHuL
Maybe you are looking for
-
Hi their, I have multiple data flows doing 90% of the process same. The difference is in source query where clause and target flat file. I used the global variables to dynamically change the query where clause easily, but I need help in dynamically c
-
I have an issue like for one of the GL Account in 2008 the values are showing in FAGLB03 but i am unable to see the Line item entries. but when i see in 2009 for the same GL Account the closing balance of 2008 is not updated for the year 2009 But whe
-
Setting control bar to resume auto-play (Captivate 6)
Hi, I am currently using Captivate 6 to create an eLearning course. We have decided to display the bottom control bar to allow flexibility for the student to move between screens in each lesson. Currently if the student uses the progress arrow in t
-
Inbound idoc to R/3 from XI
Hi , i am trying to post an idoc from Xi to R/3 system . I m using a file system as the input for the idoc and later using a communication channel of idoc adapter type to transfer the idc thus generated to the R/3 system . The file syetm i m using is
-
Trouble recapturing, reached end of tape
I am recapturing some clips that I recently lost but on one of the clips, it goes to the end of my tape. So when I am recapturing, the tape stops but FCE doesn't record it and goes back to the capture screen to start over. Is there anything I can do