Upload files!
Hi,
I´m making an aplication where i creat coments and with the coment i wanted to upload a file. So i have the file table T_File{id_file, date, file, mime_type, filename, filesize,id_coment}
T_coment{id_coment, coment,date,user}
i have a form to creat a coment and the form to upload the file, it work´s fine and i upload correctly the file when i creat the coment, but i dont know of to associate the the file to the coment in ulpoad procedure:
INSERT INTO T_File
(id_file, date, file, mime_type, filename, filesize,id_coment)
SELECT SYSDATE,blob_content, mime_type, filename, doc_size, ?,
FROM htmldb_application_files
WHERE NAME = :P5_File;
DELETE FROM htmldb_application_files
WHERE NAME = :P5_File;
The id_coment is created with a trigger ,when i creat i coment!
Thank´s in advance
As Tyler said, you may use the
return into
clause to get the primary key of your comment into an item, before you do the upload. After that, you may use this primary key to put it into the proper column in your file table.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------
Similar Messages
-
Adobe Muse won't publish (Error uploading file)
After making simple animations using Adobe Edge Animate it seems as though none of the assets will publish with my site after importing them into Muse.
In Edge animate I saved for "web animation" and published. Then I went to muse and hit "place". I went to preview and everything works fine. When I go to publish there are always errors in uploading my assets with '.png' extensions.
Any help is much appreciated. I have completely scrapped my website and created another, reinstalled Animate and have renamed all my files, I'm not sure whats wrong here.
I got one animation working, and that can be seen here under the Photography section, but I have multiples that will be shown on my page at one time.
http://chasebodydesign.businesscatalyst.comI get the error uploading file everytime I try publishing the animation.
-
1. when use com.oreilly.servlet.MultipartRequest to handle the file upload, can I change the upload file name .
2. how com.oreilly.servlet.MultipartReques handle file upload? do it change to byte ?
what different? if I use the following method?
File uploadedFile = (File) mp.getFile("filename");
FileOutputStream fos = new FileOutputStream(filename);
byte[] uploadedFileBuf = new byte[(int) uploadedFile.length()];
fos.write(data);
fos.close();My questions are
1) when use oreilly package to do file upload , it looks like i line of code is enough to store the upload file in the
file direction.
MultipartRequest multi =
new MultipartRequest(request, dirName, 10*1024*1024); // 10MB
why some example still use FileOutputStream?
outs = new FileOutputStream(UPLOADDIR+fileName);
filePart.writeTo(outs);
outs.flush();
outs.close();
2) can I rename the file name when I use oreilly package? -
Request.getParameter() when uploading files
Hi, I need to upload files and do other works .. such that, in my html ..
<form name="composer" method="post" ENCTYPE="multipart/form-data">
<input type=hidden name="a" value="a">
<input type=File name=inputfile>
<inpu type=button name=Upload onClick='upload file'>
<inpu type=button name=otherStuff onClick='do other stuff'>
</form>
In the jsp for 'do other stuff', I have the following statement to get the value of a
String a = request.getParameter("a");
However, it returns 'null', if I erase the 'ENCTYPE' part from the html file, it works. How can I get it right?If your ENCTYPE is multi-part/form-data, then there is another technichque to read the form parameters.
request.getParameter() won't work.
first u need to read the requenct explicitely and divide the contents into parameters, files etc. and then read the parameter values.
you can get a lot of stuff regarding this on web, like 'uploading files using jsp'.
have fun!! -
Remove link for uploaded files in application
Hi all,
I've been following the tutorial on how to upload and download files in application at http://download-uk.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32469/up_dn_files.htm. I have now created my own table which stores the uploaded files and can download them successfully. I would now like to add the ability to delete these files within the application and was wondering what the best way of doing this was?
I would like to add another column to the displayed report with a 'Remove file' link for each listed file, which when clicked would delete the file from the table. I've already tried using a similar method to the one used to upload the files (instead of uploading the file, the called procedure deletes it from the table using the specified ID), but this causes the application to display a blank page when the link is clicked, which I dont want (but does delete the file).
I would appreciate any suggestions.
Regards,
DaveDave,
See the login page:
http://htmldb.oracle.com/pls/otn/f?p=31517:101
There are details on how to access the application builder, where you can see how the
setup of that download, delete, upload application has been done.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Delete an uploaded file (in custom table) from a report
Hi,
I have a report of uploaded files (the files are saved in my own table, not in APEX_APPLICATION_FILES) - I'd like to add a delete link to each file in my report so that the user can delete a particular file.
How do I go about doing this?
Thanks.Melissa,
It is now working. You missed couple of things:
1. javascript in the header
2. you were pointing to the page 1 and your process was on the page 2
3. you passed the value to a non existing item on the page 3
4. the request which would fire the delete process was triggered by a wrong request
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
How to upload file from a client machine to server machine
hei evryone!
can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
any sample code/ ideas would be much appreciated.Thx!!!!hei evryone!
can anyone pls help me on how i can upload file from a client machine to another machine (or server). using jsp.Then later on, i can also retrieve the names of these files to place it as values for option tag in an html form.I have a seperate screen for uploading the file and the screen for displaying all the files that were uploaded on the server...
any sample code/ ideas would be much appreciated.Thx!!!! -
How to upload file from client to server
Can someone please help.
User needs to browse file on his desktop and upload file using browse button. This file should then be uploaded to the server. I am using javascript in the front end and servlet in the back.
Any help will be highly appreciated.
Thanks,
IndrasishJakarta Commons FileUpload is the standard way of doing the file uploading these days. You can find source, binaries and documentation at the Jakarta Site http://jakarta.apache.org/ . The Commons has a number of subprojects, so start with the Commons libraries, then find FileUpload.
Brian -
How to upload file from client to server in servlets.
actually in my application i have to upload file from client m/c to server.
it is not possible through file i/p stream as fileStreams does not work on network. Please mail me if you have any solution to this.
Thank's in advance............Haii roshan
Pls go through this thread..
http://forum.java.sun.com/thread.jspa?forumID=45&threadID=616589
regards
Shanu -
How to upload file from Application Server?
Dear Friends,
How to upload file from Application Server?
Plz. with example...
Regards,
Dharmeshhi,
check the code for upload from application server.
tables: kna1.
types: begin of s_file,
customer type kna1-kunnr,
country type kna1-land1,
name type kna1-name1,
region type kna1-regio,
end of s_file.
*--Internal tables
data: it_file type s_file occurs 0 with header line.
*-- Selection screen
selection-screen: begin of block b1 with frame title text-001.
parameter: p_file type rlgrap-filename default 'C:/customer.txt'
obligatory.
selection-screen: end of block b1.
*-- At selection screen
at selection-screen on value-request for p_file.
perform file_help using p_file.
*-- Process File
start-of-selection.
perform upload_file using p_file.
*-- write File data to o/p
end-of-selection.
perform write_data.
*& Form file_help
form file_help using p_p_file.
data: l_filepath type ibipparms-path.
call function 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
importing
file_name = l_filepath
p_p_file = l_filepath.
endform. " file_help
*& Form upload_file
form upload_file using p_p_file.
call function 'WS_UPLOAD'
exporting
filename = p_p_file
filetype = 'DAT'
IMPORTING
FILELENGTH =
tables
data_tab = it_file
exceptions
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
no_authority = 10
others = 11
if sy-subrc <> 0.
message i001.
endif.
endform. " upload_file
*& Form write_data
form write_data .
loop at it_file.
write:/ it_file-customer, it_file-country, it_file-name,
it_file-region.
endloop.
endform.
regards,
keerthi. -
Is there a way to silently upload files?
Ok, so I've taken the plunge. I've started working on an AIR
app using Flash CS3. I'm putting together a little app that will
keep my online store updated with all the product updates from our
wholesaler. This includes parsing a csv file, downloading product
images from the wholesaler, updating the database, and then
uploading the images to our server.
The problem is that AIR does not seem to have the
functionality to silently upload files! Sure, I can use the
file.reference object to fire off the browse method, which then
opens the OS file browser window BUT I would really like the whole
thing to be hands off. In the past, I've written these types of
apps using Visual Studio but I haven't touched VS in two years.
Has anyone run across a way to silently upload or ftp files
in AIR?Hey Oliver,
Thanks for your answer--the fact that it CAN be done has
gotten me a lot further on finding a solution. Here's what I have
so far. As it runs, I can see the progress and completion of the
upload but I'm still not getting it saved. I'm uploading it to a
ColdFusion processing page.
AS3 Code:
import flash.filesystem.*;
import flash.net.URLRequest;
//Silent File Upload (no browse window)
function imageUpload(imageName,uploadPage):void
trace('Starting Upload of ' + imageName + '\n');
var myFile:File =
File.applicationDirectory.resolvePath(imageName);
var request:URLRequest = new URLRequest(uploadPage);
request.method = URLRequestMethod.POST;
myFile.addEventListener(ProgressEvent.PROGRESS,progressHandler);
myFile.addEventListener(Event.COMPLETE,completeHandler);
myFile.upload(request,"theFile");
function progressHandler(event:ProgressEvent):void {
var file:FileReference = FileReference(event.target);
var pLoaded =
Math.ceil(event.bytesLoaded/event.bytesTotal*100);
trace(pLoaded + '% uploaded');
function completeHandler(event:Event):void
trace ('Upload complete.');
var uploadPage = "
http://www.aaronbday.com/upload_file.cfm";
imageUpload("angelic_cat.jpg",uploadPage);
Here's the CFM page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Upload File</title>
</head>
<body>
<cfif isDefined("form.theFile")>
<!---we only want images--->
<cffile
action="upload"
destination="#ExpandPath("test/")#"
filefield="theFile"
nameconflict="overwrite"
accept="image/jpg,image/jpeg,image/gif,image/pjpeg"
>
<cfoutput><img src="test/#cffile.serverFile#"
/></cfoutput>
<cfelse>
<form method="post" action="upload_file.cfm"
enctype="multipart/form-data">
<input type="file" name="theFile" />
<input type="submit" name="Submit" />
</form>
</cfif>
</body>
</html>
Any ideas? Thanks! -
Problem while uploading file from application server to internal tab in BG
Hi all,
When i see the file in application server.data is like this
#################00\);_(#####}#-#}###############################00\);_(#####}#-#}###############################00\);_(*#####}#-#}#########
###################}###}#############A#############???#00\);_(*#################;_(@_) ########???# ########???# ########???###
#######???#########}###}#############)##############}##00\);_(*#################;_(@_) ############ ############ ##############
###################}#A#}#############:##############}##00\);_(#################;_(@_) }###}##############################00\);_(*##########
#######???#########}#-#}#############F#################00\);_(#####}###}#############@#################00\);_(#################;_(@_) #####
###################}#-#}#############3#################00\);_(#####}#U#}#############E#################00\);_(#################;_(@_) #####
Because the csv which is uploaded has dropdowns and some formattings.
when download from tcode cg3y i am getting correct file
When try to use open(binary mode) and read dataset i getting data as it is (junk).
i need to process in background.
Any help.
Rhea.upload file to string format
begin of ty_tab,
string type char200,
end of ty_tab.
loop at ty_tab into string
use statement replace string into tab deliminated fromat(particular occurance in string)
now call class to break string at tab into fields
endloop.
DATA : BEGIN OF i_data OCCURS 0,
data(200) TYPE c, "To hold Upload file data
END OF i_data.
OPEN DATASET v_str FOR INPUT
IN TEXT MODE
ENCODING DEFAULT IGNORING CONVERSION ERRORS.
IF sy-subrc EQ 0.
DO.
*Read a line from input file
READ DATASET v_str INTO i_data-data.
IF sy-subrc NE 0.
EXIT.
ENDIF.
*Append record to an internal table
APPEND i_data.
CLEAR: i_data.
ENDDO.
*Close the file
CLOSE DATASET v_str.
*---Start of inserti
LOOP AT i_data.
REPLACE ALL OCCURRENCES OF '"' IN i_data WITH '#'.
SPLIT i_data AT cl_abap_char_utilities=>horizontal_tab
INTO i_doc-pvaudt
i_doc-pvpate
i_doc-vecatc
i_doc-vhvend
i_doc-vhidt8
i_doc-vhinvn
i_doc-vhhexp
i_doc-vhiref. -
FI Upload file (Approval Workflow)
Hi All,
Need some assistance:
Currently our company has a standard approval workflow built. So when we receive an invoice without a PO, we manually post the invoice to a GL & Cost Centre. Once the invoice is coded, It’s then sent to the GL owners to approve using the workflow currently in place. All this works perfectly fine.
My issue is FI Upload files……. As Upload files contain several GL accounts – we are currently attaching a manual email approval from the approver to the file upload so the Accounts Payable department could post without any further approvals in Workflow as an email approval is sufficient.
We would like to build the same workflow approval cycle that we have already in place for Fi Invoices.
Note – an upload file come in with 10 different GL accounts ( ideally we don’t want to send it to 10 different approvers) as this will slow down the process, so I was wondering if there is a better solution that you could share to eliminate the upload going to 10 approvers.
Any Suggestions are greatly appreciated.
Thanks
AlexHi All,
Need some assistance:
Currently our company has a standard approval workflow built. So when we receive an invoice without a PO, we manually post the invoice to a GL & Cost Centre. Once the invoice is coded, It’s then sent to the GL owners to approve using the workflow currently in place. All this works perfectly fine.
My issue is FI Upload files……. As Upload files contain several GL accounts – we are currently attaching a manual email approval from the approver to the file upload so the Accounts Payable department could post without any further approvals in Workflow as an email approval is sufficient.
We would like to build the same workflow approval cycle that we have already in place for Fi Invoices.
Note – an upload file come in with 10 different GL accounts ( ideally we don’t want to send it to 10 different approvers) as this will slow down the process, so I was wondering if there is a better solution that you could share to eliminate the upload going to 10 approvers.
Any Suggestions are greatly appreciated.
Thanks
Alex -
Using ABAP Webdynpr How to Upload File and download file in SAP R/3
Hi SAP GURUS ,
I wanted to save employee profile from ESS to SAP so i am creating ESS Application .
For that I go with BDS Approach and create test program for this I got success while uploading file in my folder
which i have created with the help of class and content repository . but when i Using ABAP Webdynpro , i got error FM "BDS_BUSINESSDOCUMENT_CREATEF" message " error_kpro " .
Also I wanted to use KM for storage of Documents and wanted to retrive with help of ABAP Webdynpro .
So pls tell me / mailed me the process , approach and if you have examples .
Thanks in Advance ,
Vishwassap at gmailHi Vishwas,
Check out the thread [Efficient way of saving documents uploaded|Re: Efficient way of saving documents uploaded by users; and check the blog by Raja Thangamani.
Also check the thread [Export Images through Function Modules |Export Images through Function Modules;.
Hope it helps you. -
Upload file to global directory in Dev, Q&A and Prod!
I have an upload application in BSP, that uploads files to for example /usr/sap/BWD/files
this works in Development, but of course this directory is not available in Production, so BSP won't work there.
Isn't it possible to use one global directory?
Right now somebody created for us a directory, that's the same on all 3 systems (Dev, Q, and Production)
this dir is
on Development: DIR_TRANS /usr/sap/transBW
on Quality: DIR_TRANS /usr/sap/transBW
on Production: DIR_TRANS /usr/sap/trans
notice the small difference in path in Production... Is there a way to use the DIR_TRANS instead of the real path?
my application writes data like this:
fname = '/usr/sap/CBD/files/FILE.CSV'.
OPEN DATASET fname FOR OUTPUT in TEXT MODE encoding default.
if sy-subrc gt 0.
WRITE: / 'Error opening file'.
endif.
LOOP AT data_TAB INTO LIN.
TRANSFER LIN TO FNAME.
ENDLOOP.
CLOSE DATASET FNAME.
thanks a lot, points will be rewarded for usefull answers!
thanks!use transaction FILE to create logical path for the actual file path.
and then use FM
call function 'FILE_GET_NAME'
exporting
client = sy-mandt
logical_filename = pil_file "Input logical file name
operating_system = sy-opsys
importing
file_name = p_i_file "Physical file name
exceptions
file_not_found = 1
others = 2.
Regards
Raja -
Questions about OAS Portal Forms to upload files
Hello,
I have quetions, about uploading files, see I need to creat a form that will be used by other people to upload information that later will be presented as downloads in the portal...
so I created a form in my provider with a file (binary) field, and it mimes to my table in the DB, to the field "Archivo", then what I do is use a omniportlet and using HTML format I present like a link using the info in the field Archivo
and when I clic on it it takes me to this link
http://desarrollo06:7778/pls/portal/38173.PDF
but the file I uploaded does not appear
can aniyone help me to solve this?
thanks in advances for the suggestions and your time ^_^The method you used to setup upload of file seems fine. I suppose you would have used a blob type to save the file in your db table.
basically, you can develop a report offering a link calling perhaps a procedure which would query from the table and download the file.
In that procedure, you would look for the file (vblob) and the mime_type from that table using a sql-query. then use them to setup the mime type for the http protocol, and download the file as follows.
owa_util.mime_header(mime_type);
owa_util.http_header_close;
wpg_docload.Download_File(vblob);
hope that helps!
AMN
Maybe you are looking for
-
Minisap installation problem on windows 7
Hello all... I am new to the software field and I want to learn sap. I bought the book ABAP OBJECTS by Horst & Keller, which came with 2 cds. I was unable to complete the installation because of the following error.. info: INSTGUI.EXE Protocol versio
-
My Final Cut Pro 7.0.3 WON'T OPEN!
I recently dumped so applications on my Mac OS X 10.6.8 Then when I try to open my FCP 7.0.3 it comes up with this info below. Can anybody understand this and help! Been down for days with huge deadlines. PLEASE HELP! - PATRICK Process: Fi
-
I have a PDF file with over two hundred individual links in it, as well as numerous other PDF files with one or more links in them each. There has been a restructuring of the webserver and I need to make updates to all of the links to reflect this ch
-
Problem with a/c entries while GRN..
Dear All, I have a different problem in GR/IR For example my PO no is 123 and qty are 2 kgs and value is 2 Rupees (i.e. - 1rupee per kg) Now i have removed GR based invoice verification and did the invoice posting first with wrong qty but correct val
-
LG 2012 TV with AN-VC400 TV Cam - pathetic support...
All I can say about LG's & Skype's partnership is "Stay Away"! I bought a 2012 LG TV (LM47640T £800) with their dedicated Skype Cam (AN-VC400 £90) only to find that the week I bought it, the skype software disappeared from the TV. 3 months later,