How to upload a file with a HTML form into a BLOB ?
Hi,
I want to upload a file into a BLOB.
I have created a procedure in PL/SQL whitch generates an html form.
You can upload a file with <input type="file" name="my_file">.
How can I insert this file into my database ?
Thank's for your Help
Estelle
Hi Estelle,
Portal Applications forum is a more apporpriate forum for such questions. Please post your question there.
Thanks,
Ravi
Similar Messages
-
How to upload large file with http via post
Hi guys,
Does anybody know how to upload large file (>100 MB) use applet to servlet with http via post method? Thanks in advance.
Regards,
Mark.Hi SuckRatE
Thanks for your reply. Could you give me some client side code to upload a large file. I use URL to connect to server. It throws out of memory exception. The part of client code is below:
// connect to the servlet
URL theServlet = new URL(servletLocation);
URLConnection servletConnection = theServlet.openConnection();
// inform the connection that we will send output and accept input
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
// Don't used a cached version of URL connection.
servletConnection.setUseCaches (false);
servletConnection.setDefaultUseCaches(false);
// Specify the content type that we will send text data
servletConnection.setRequestProperty("Content-Type",
+"application/octet-stream");
// send the user string to the servlet.
OutputStream outStream = servletConnection.getOutputStream();
FileInputStream filein = new FileInputStream(largeFile);
//BufferedReader in = new BufferedReader(new InputStreamReader
+(servletConnection.getInputStream()));
//System.out.println("tempCurrent = "+in.readLine());
byte abyte[] = new byte[2048];
int cnt = 0;
while((cnt = filein.read(abyte)) > 0)
outStream.write(abyte, 0, cnt);
filein.close();
outStream.flush();
outStream.close();
Regards,
Mark. -
How to upload a file in Oracle 9i forms !!!!
How can we upload a file in oracle 9i forms. GET_FILE_NAME does not work in Oracle 9i forms
Have you looked at the functionality provided by webutil?
http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm
The 1.0.6 release has been certified with 9.0.4 and 10.1.2.0.2 of Oracle Forms. -
How to upload .csv file with tab as delimiter.
HI,
I want to upload a .csv file with tab as delimiter to unix path in background.
I know there is function module 'GUI_UPLOAD', but in my case data is available in an internal table .
upload the *.CSV :
OPEN DATASET lv_filename
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
* Write file records into file on application server
LOOP AT gt_datatab INTO gs_datatab.
TRANSFER gs_datatab TO lv_filename.
ENDLOOP.
CLOSE DATASET lv_filename.Bhanu,
Define a local variable of type CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
LV_TAB TYPE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
LOOP AT GT_DATATAB INTO GS_DATATAB.
CONCATENATE GS_DATATAB-FIELD1
GS_DATATAB-FIELD2
GS_DATATAB-FIELDN
INTO LV_STRING SEPARATED BY LV_TAB.
TRANSFER LV_STRING TO lv_filename.
ENDLOOP.
Thanks,
Vikram.M -
Reading html data & uploading a file in single html form using htp package
Hi
I have designed a html screen using htp package in which i have few text items and file upload button. I have to validate all forms data like text items and check box elements and upload file to unix. I am using java script for file validations and cgi script to upload file. With this I am able to either read form data or upload file but not both.
At a time I want to insert a record to database with html form values and upload file to unix with htp package. Please suggest how can I read html form data + uploading a file to unix simultaneously in a single htp procedure.
Thanks,
PradeepHave you ever considered using Application Express (APEX)?
Oracle Application Express (APEX)
Sounds like you're going the long way around to create a web based application. -
How to reference a file with the XML Forms Builder?
Hello,
I've created a form at the XML Form builder (I am using NW 04). This enables the users to create new topic.
I've created at at the "Edit" form an option to upload a file along with the new topic. The file is being saved in a subfolder of the topics main folder.
My question is how to create a link to the specific file that has been uploaded with it's specific topic at the "Show" Form? Note that the subfolder contains files of many topics, I want to link to this specific file uploaded with it's relevant topic when created. How do I do that?Hi Roy,
> I've created at the "Edit" form an option
> to upload a file along with the new topic.
What I expect that you have done is to add a browse functionality which browses within KM with the possibility to upload an image into KM?! As done within SAP Demo News?!
If that's the way, just compare the SAP Demo News: Create /DataSchema/News/image and map it to the browser, whereas in the show form part you'll map it to an image.
If I didn't understand you right and the issue is still open, please report...
Hope it helps
Detlev -
How to put two files with the same name into the same folder?
How can I put two files with the same name and the same extention into the same directory?
Is this even possible?
Thanks in advance.Are you sure? I would be very surprised if that was the case.
How does the computer/filing system differentiate the files, if not by their names?
How do you tell the computer which one you want? (On the command line.) -
How do upload a file to the application server into a directory?
hi to all,
i want to upload file into the database..i need upload the file into the application server and save it to a directory..is there any way?where i can read about this?any information?
ashwinyHello,
First, we need to determine the terms we are using, in order to avoid confusion. We (including the documentation) are using "upload" to describe storing the file on the server, and "download" to pull it from the server into local machine.
You can use the "File Browse" item to upload any file you need from your local machine and into a database table. The default APEX configuration (in the dads.conf file) stored the uploaded file in a table called wwv_flow_file_objects$. In your application, you can access this table using a view called APEX_APPLICATION_FILES.
After you uploaded a file, any user can access it, using the download procedure described in the reference I gave you. The download procedure gives you an option to store the download file anywhere you need, using the "Open/Save" dialog box.
I believe this is covering everything you need. If you still having problems, please consider posting the relevant application pages on apex.oracle.com. It will be easier to understand and help you.
Regards,
Arie. -
How to attach HLP file with the existing forms
We have FORMS 5.0 application running. We have developed .HLP and .CNT files using ROBOHELP utility. I would like to attach the help file to the existing form. I want to use the registry to set the help file path so that I won't hardcode the path. I tried
using WINHLP32.exe file using the HOST command. This need path settings in the machine. Does any body know other methods instead of using HOST command.
Thanks in advance.
Bye
Meenakshi Sundaram GaneshYou could use the d2kwutil.pll and execute the Win_api_shell.Winhelp procedure
-
How to move independent files with emails in them into Thunderbird
I am trying to fix things for my mother. For some reason emails and folders started disappearing in Oulook, so I ran all the scans. My bf then took over and he believes it's because she had a bunch of subfolders and Outlook as problems with that. Well we were able to save the emails and folders and I figured out that we could use undbx to get them back to a more normal state. Well now they are all sitting on the desktop in a file, but I can't figure out how to get them onto Mozilla Thunderbird, which we decided to switch to. If I copy the folder into the profile it sees the folders, but not the emails. I'm figuring that I need to find a way to get it into msf format, or find a program that's easier to put them on, then import to Thunderbird.
undbx as I understand it deals with outlook express DBX files by converting them into individual EMLs file one per email.
Based on that understanding install the [https://addons.mozilla.org/en-US/thunderbird/addon/importexporttools/ import export tools] add-on using the instructions [http://chrisramsden.vfast.co.uk/3_How_to_install_Add-ons_in_Thunderbird.html here].
Note that F10 makes the menu bar visible so you can access the tools menu where the add-on installs. -
How to Use a Picklist with a HTML form
I use the HTMl Web Bean Edit Form. I want to add a text box in the second cell of the table instead of creating a new row.
Furhter How can I specify a Picklist which fetches data from a view object on the same form.
nullTo Add a Text box, use the following:
<input TYPE="text" NAME="textFieldName" SIZE="25">
To Add a Radio button group, use this example:
<input TYPE="radio" NAME="radioVar" VALUE="1">
To Add a PickList, use the following example:
<select NAME="qHowSoon"><option SELECTED><select>
</option><option>June 99
</option><option>July 99
</option><option>August 99
</option><option>September 99
</option></select>
For more details, I would suggest you
get a good book / online help on HTML.
John@Oracle JDeveloper Team http://technet.oracle.com
null -
How to upload a file into server using j2ee jsp and servlet with bean?
How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
Anyone help me please!u don't need j2ee and struts to do file uploading. An example is as such
in JSP. u use the <input> file tag like
<input type="file"....>You need a bean to capture the file contents like
class FileUploadObj {
private FormFile srcFile;
private byte[] fileContent;
// all the getter and setter methods
}Then in the servlet, you process the file for uploading
* The following loads the uploaded binary data into a byte Array.
FileUploadObj form = new FileUploadObj();
byte[] byteArr = null;
if (form.signFile != null) {
int filesize = form.srcFile.getFileSize();
byteArr = new byte[filesize];
ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
bytein.read(byteArr);
bytein.close();
form.setFileContent(byteArr);
// Write file content using Writer class into the destination file in the server.
... -
Upload multiple files WITH correct pairs of form fields into Database
In my form page, I would like to allow 3 files upload and 3 corresponding text fields, so that the filename and text description can be saved in database table in correct pair. Like this:
INSERT INTO table1 (filename,desc) VALUES('photo1.jpg','happy day');
INSERT INTO table1 (filename,desc) VALUES('photo2.jpg','fire camp');
INSERT INTO table1 (filename,desc) VALUES('photo3.jpg','christmas night');
However, using the commons fileupload, http://commons.apache.org/fileupload/, I don't know how to reconstruct my codes so that I can acheieve this result.
if(item.isFormField()){
}else{
}I seems to be restricted from this structure.
The jsp form page
<input type="text" name="description1" value="" />
<input type="file" name="sourcefile" value="" />
<input type="text" name="description2" value="" />
<input type="file" name="sourcefile" value="" />The Servlet file
package Upload;
import sql.*;
import user.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Map;
import java.util.HashMap;
import java.util.Date;
import java.util.List;
import java.util.Iterator;
import java.io.File;
import java.io.PrintWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.*;
public class UploadFile extends HttpServlet {
private String fs;
private String category = null;
private String realpath = null;
public String imagepath = null;
public PrintWriter out;
private Map<String, String> formfield = new HashMap<String, String>();
//Initialize global variables
public void init(ServletConfig config, ServletContext context) throws ServletException {
super.init(config);
//Process the HTTP Post request
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Thumbnail thumb = new Thumbnail();
fs = System.getProperty("file.separator");
this.SetImagePath();
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if(!isMultipart){
out.print("not multiple part.");
}else{
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = null;
try{
items = upload.parseRequest(request);
} catch (FileUploadException e) {
e.printStackTrace();
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if(item.isFormField()){
String formvalue = new String(item.getString().getBytes("ISO-8859-1"), "utf-8");
formfield.put(item.getFieldName(),formvalue);
out.println("Normal Form Field, ParaName:" + item.getFieldName() + ", ParaValue: " + formvalue + "<br/>");
}else{
String itemName = item.getName();
String filename = GetTodayDate() + "-" + itemName;
try{
new File(this.imagepath + formfield.get("category")).mkdirs();
new File(this.imagepath + formfield.get("category")+fs+"thumbnails").mkdirs();
//Save the file to the destination path
File savedFile = new File(this.imagepath + formfield.get("category") + fs + filename);
item.write(savedFile);
thumb.Process(this.imagepath + formfield.get("category") +fs+ filename,this.imagepath + formfield.get("category") +fs+ "thumbnails" +fs+ filename, 25, 100);
DBConnection db = new DBConnection();
String sql = "SELECT id from category where name = '"+formfield.get("category")+"'";
db.SelectQuery(sql);
while(db.rs.next()){
int cat_id = db.rs.getInt("id");
sql = "INSERT INTO file (cat_id,filename,description) VALUES ("+cat_id+",'"+filename+"','"+formfield.get("description")+"')";
out.println(sql);
db.RunQuery(sql);
} catch (Exception e){
e.printStackTrace();
HttpSession session = request.getSession();
UserData k = (UserData)session.getAttribute("userdata");
k.setMessage("File Upload successfully");
response.sendRedirect("./Upload.jsp");
//Get today date, it is a test, actually the current date can be retrieved from SQL
public String GetTodayDate(){
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String today = format.format(new Date());
return today;
//Set the current RealPath which the file calls for this file
public void SetRealPath(){
this.realpath = getServletConfig().getServletContext().getRealPath("/");
public void SetImagePath(){
this.SetRealPath();
this.imagepath = this.realpath + "images" +fs;
}Can anyone give me some code suggestion? Thx.When one hits the submit button - I then get a 404 page error.What is the apaches(?) error log saying? Mostly you get very useful information when looking into the error log!
In any case you may look at how you are Uploading Multiple Files with mod_plsql. -
I am very new to this JDeveloper & BPEl Process , please could some one help in ersolving my problem that is , how to upload a file in BPEL Console Using JSP in JDeveloper.
Hi,
ADF Faces provides you with the file upload component
http://download-uk.oracle.com/docs/html/B25947_01/web_complex006.htm#CEGCEDHF
http://download-uk.oracle.com/docs/html/B25947_01/appendixa007.htm#CHDEDCFA
This gives you a handle to the file content. However, uploading files through a service is different and I suggest to consult teh BPEL forum for this BPEL
Frank -
How to get the file path from HTML input form in Firefox 3...
In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like 'C:\folder1\folder2\folder3\filename' it works properly and gives the full path to the file and the filename.
In Firefox 3, it returns only 'filename', because of their new 'security feature' to truncate the path, as explained in Firefox bug tracking system (https://bugzilla.mozilla.org/show_bug.cgi?id=143220)
I have no clue how to overcome this 'new feature' because it causes all upload forms in my webapp to stop working on Firefox 3.
Can anyone help to find a single solution to get the file path both on Firefox 3 and IE7?
Thanks in advance....As you're posting this in the JSF forum and looking at your [previous topic|http://forums.sun.com/thread.jspa?threadID=5342365], I assume that you're using Tomahawk's t:inputFileUpload. In this case, just use UploadedFile#getInputStream(). You may find this article useful: [http://balusc.blogspot.com/2008/02/uploading-files-with-jsf.html].
By the way, are you lazy or just dumb? You wasted one week to this! I've posted the aforementioned article one week ago. How did you stuck?
Maybe you are looking for
-
I am trying to uninstall itunes and keep getting an error that reads "the feature you are trying to use is on a network resource that is unavailable." Itunes on windows. Help!
-
Unable to turn Wi-Fi or Bluetooth on or off because the setting is grayed out or dim.
-
Restoring iphone backup from itunes account with multiple phones.
Hi, I wonder if anyone can please help. Problem as follows: Backed up/synced both my wifes and my iphone 4 to the same itunes account on Macbook. Wifes phone gets stolen, so get myself new iphone 5 and new Macbook. Managed to set up and get my data o
-
Combine movie and soundtrack exported from Keynote
Hi! I have made a presentation in Keynote '09 and have added some audio as a soundtrack to it (playing throughout the presentation). When exporting to the Quicktime movie, I get two files, presentation.mov and presentation_soundtrack.mov (the option
-
RHINTE00 - Transfer of position
Hi all, I need some assitance to understand how can I run RHINTE00. Our business scenario : 1. Integration will be active (an entry 'X' in t77s0) 2. I want to keep the text ( for eg of object position )maintained in OM with no truncation. Please ass