Upload file to read as external table from client to DB server using webutil

Hi I was wondering if this is possible
The requirement is I need to up load a comaseprate file to db server from client, so to read this fie as an external table
When we have doing is to create a samba share on the DB server and just do a copy to the network share and consequentially read the file in to the database
My environment - Forms 11R2 and 11g2
Can this be done using webutil ( from client to db server
Thanks nad regards

Hi thanks for the reply!
Currently the application runs with a samba share, we need to get read of this share and directly load the file to DB server (on unix file system, then there wont be much changes to the existing code), is this possible?
Ells I was thinking the same as you say just load the file in to the database and do some other PL/Sql or shell scripts to do the rest of the operation. it would be better to use a PL/Sql via a trigger I believe unfortunately I am not an Pl/Sql programmer ((, guess one of our developers need to find the coding part ))
Appreciate if you can give me some example like
Thanks and best regards

Similar Messages

  • Issue while importing table from oracle to sql server using import and export wizard

    Hi All,
    I am trying to populate oracle table to sql server using import export wizard  and i am getting the below error.the table is allready present in the database but still it throwing error like table doesn't exists.
    Could not connect source component.
    Error 0xc0202009: Source - JOB_ACTION_HISTORY [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    Error 0xc02020e8: Source - JOB_ACTION_HISTORY [1]: Opening a rowset for ""FLXUSER"."JOB_ACTION_HISTORY"" failed. Check that the object exists in the database.
     (SQL Server Import and Export Wizard)
    Kindly help me out
    Thanks in advance

    Hi Snehasis,
    Please check whether the table name in the Oracle database has lower case letters. The table name should be exactly correct. 
    In addition, the issue might be related to the Oracle driver. What provider/driver do you use? If you use Microsoft OLE DB Provider for Oracle, you can try the
    Oracle OLE DB Provider. If you use Enterprise or Developer edition of SSIS 2008 or higher, you can also try the
    Microsoft Connectors for Oracle by Attunity. The  Oracle OLE DB Provider and Microsoft Connectors for Oracle are proved to have better performance.
    Regards,
    Mike Yin
    TechNet Community Support

  • Creating external table - from a file with multiple field separators

    I need to create an external table from a flat file containing multiple field separators (",", ";" and "|").
    Is there any way to specifiy this in the CREATE TABLE (external) statement?
    FIELDS TERMINATED BY "," -- Somehow list more than just comma here?
    We receive the file from a vendor every week. I am trying to set up a process for some non-technical users, and I want to keep this process transparent to them and not require them to load the data into Oracle.
    I'd appreciate your help!

    scott@ORA92> CREATE OR REPLACE DIRECTORY my_dir AS 'c:\oracle'
      2  /
    Directory created.
    scott@ORA92> CREATE TABLE external_table
      2    (COL1 NUMBER,
      3       COL2 VARCHAR2(6),
      4       COL3 VARCHAR2(6),
      5       COL4 VARCHAR2(6),
      6       COL5 VARCHAR2(6))
      7  ORGANIZATION external
      8    (TYPE oracle_loader
      9       DEFAULT DIRECTORY my_dir
    10    ACCESS PARAMETERS
    11    (FIELDS
    12         (COL1 CHAR(255)
    13            TERMINATED BY "|",
    14          COL2 CHAR(255)
    15            TERMINATED BY ",",
    16          COL3 CHAR(255)
    17            TERMINATED BY ";",
    18          COL4 CHAR(255)
    19            TERMINATED BY ",",
    20          COL5 CHAR(255)
    21            TERMINATED BY ","))
    22    location ('flat_file.txt'))
    23  /
    Table created.
    scott@ORA92> select * from external_table
      2  /
          COL1 COL2   COL3   COL4   COL5
             1 Field1 Field2 Field3 Field4
             2 Field1 Field2 Field3 Field4
    scott@ORA92>

  • Need help- need to read a customer table from the payroll schema

    Hi gurus,
    I need to read an amonunt from a customer table in the payroll schema. Is it possible to input TABLE XXXX in the schema, or is impossible to read from a customer table?Do I need to create a report to upload the amount in an infotype?
    Thanks in advanced for for support!

    You should create your own custom operation (based on operation TABLE) to read your custom table from a Payroll PCR.
    If your custom table's name is longer than 5 characters, you may be required to use operations VAOFF and/or VALEN prior to your custom operation in the PCR.

  • How can i load file into database from client-side to server-side

    i want to upload file from client-side to server-side, i use the following code to load blob into database.
    if the file is in the server-side, it can work, but if it in the client-side, it said that the system cannot find the file. i think it only will search the file is in the server-side or not, it will not search the client-side.
    how can i solve it without upload the file to the server first, then load it into database??
    try
    ResultSet rset = null;
    PreparedStatement pstmt =
    conn.prepareStatement ("insert into docs values (? , EMPTY_BLOB())");
    pstmt.setInt (1, docId);
    pstmt.execute ();
    // Open the destination blob:
    pstmt.setInt (1, docId);
    rset = pstmt.executeQuery (
    "SELECT content FROM docs WHERE id = ? FOR UPDATE");
    BLOB dest_lob = null;
    if (rset.next()) {
    dest_lob = ((OracleResultSet)rset).getBLOB (1);
    // Declare a file handler for the input file
    File binaryFile = new File (fileName);
    FileInputStream istream = new FileInputStream (binaryFile);
    // Create an OutputStram object to write the BLOB as a stream
    OutputStream ostream = dest_lob.getBinaryOutputStream();
    // Create a tempory buffer
    byte[] buffer = new byte[1024];
    int length = 0;
    // Use the read() method to read the file to the byte
    // array buffer, then use the write() method to write it to
    // the BLOB.
    while ((length = istream.read(buffer)) != -1)
    ostream.write(buffer, 0, length);
    pstmt.close();
    // Close all streams and file handles:
    istream.close();
    ostream.flush();
    ostream.close();
    //dest_lob.close();
    // Commit the transaction:
    conn.commit();
    conn.close();
    } catch (SQLException e) {

    Hi,
    Without some more details of the configuration, its difficult to know
    what's happening here. For example, what do you mean by client side
    and server side, and where are you running the upload Java application?
    If you always run the application on the database server system, but can't
    open the file on a different machine, then it sounds like a file protection
    problem that isn't really connected with the database at all. That is to
    say, if the new FileInputStream (binaryFile) statement fails, then its not
    really a database problem, but a file protection issue. On the other hand,
    I can't explain what's happening if you run the program on the same machine
    as the document file (client machine), but you can't write the data to the
    server, assuming the JDBC connection string is set correctly to connect to
    the appropriate database server.
    If you can provide some more information, we'll try to help.
    Simon
    null

  • Is it possible to export (expdp) oracle table from client machine ?

    Is it possible to export (expdp*) oracle table from client machine, without using Remote desk top connection ?*
    1) Database-10g server is in America
    2) client machine is in India
    3) Oracle client-10g software is installed in my machine
    4) I am able to connect to the server, could see all tables
    5) one table is with 35 million record, I wanted to export this table using data pump, is it possible?
    note: without using Remort desk top connection.

    Hi
    I used the following syntax , but I am getting error
    6) connect sys as sysdba
    create directory test_dir as '/dbusr1/exp_test'
    grant read, write on directory test_dir to user1;
    7) expdp user1/pwd1@xyz tables=test_1 directory=test_dir dumpfile=test_file.dmp logfile=test_file.log
    8) Errors
    In linux prompt I am getting this error
    -bash: expdp: command not found
    In windows cmd prompt I am getting this error
    ORA-39002: invalid operation
    ORA-39070: Unable to open the log file.
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE";, line 488
    ORA-29283: invalid file operation
    9) why ?
    -- Does the user ( "user1") should have any system level privilege ? to export his own table?
    -- This folder ('/dbusr1/*exp_test'*) has write privilege in os level.
    Thanks in advance
    sbmk_design
    Edited by: sbmk_design on Aug 24, 2009 12:06 AM

  • SSMA for migrating table from oracle to Sql server

    Hi All,
    I wanted to replicate oracle huge table to sql server and i am using SSMA.its helpful and fast but can we replicate the table to different name using SSMA.for example i have a table TEST and i wanted to replicate it to SQL_TEST.Can it be possible
    using SSMA.
    Kindly help me out 

    Hi All,
    I wanted to replicate oracle huge table to sql server and i am using SSMA.its helpful and fast but can we replicate the table to different name using SSMA.for example i have a table TEST and i wanted to replicate it to SQL_TEST.Can it be possible
    using SSMA.
    Kindly help me out 
    Hello,
    Same question has  already been asked by you in below thead. Why you created duplicate thread ?  please avoid this practice or your thread will be marked ass Spam
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/abcdfb1b-c617-453f-828d-c8e4ec266c78/ssma-for-migrating-table-from-oracle-to-sql-server?forum=sqlintegrationservices
    Moderators plz merge this thread.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Issues with external table from excel file

    dear all,
    i have been trying to use the below statement to create an external table.this table is referencing an excel file.
    CREATE TABLE EMPFRAUD_TEST
    SERIAL_NUM VARCHAR2(10 BYTE),
    BRANCH_CODE VARCHAR2(10 BYTE),
    BUSINESS_ADD VARCHAR2(100 BYTE),
    REGIONS VARCHAR2(50 BYTE),
    TRANSACTION_DATE_TIME DATE,
    REPORT_DATE_TIME DATE,
    NO_OF_TRANS VARCHAR2(4 BYTE),
    AMOUNT NUMBER,
    FRAUD_TYPE VARCHAR2(25 BYTE),
    IMPACT_CATEGORY VARCHAR2(10 BYTE)
    ORGANIZATION EXTERNAL
    ( TYPE ORACLE_LOADER
    DEFAULT DIRECTORY EXT_EMP_TEST
    ACCESS PARAMETERS
    ( records delimited by newline
    badfile 'empfraud%a.bad'
    logfile 'empfraud%a.log'
    fields terminated by ','
    optionally enclosed by '"'lrtrim
    missing field values are null
    LOCATION ('fraud.csv')
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;
    the problems is as follows
    1) when i run the query above the table will be created,
    but when i try to select from the table,an empty table will be display.
    when i checked the error log file,the following message was given.
    it was gotten from an oracle db on unix server.
    "L_NUM
    KUP-04036: second enclosing delimiter not found
    KUP-04101: record 71 rejected in file /home/oracle/ext_folder_test/fraud.csv
    KUP-04021: field formatting error for field ACCOUNT_KEY
    KUP-04036: second enclosing delimiter not found
    KUP-04101: record 79 rejected in file /home/oracle/ext_folder_test/fraud.csv
    KUP-04021: field formatting error for field SERIAL_NUM
    KUP-04036: second enclosing delimiter not found
    KUP-04101: record 80 rejected in file /home/oracle/ext_folder_test/fraud.csv
    error processing column TRANSACTION_DATE_TIME in row 1 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01858: a non-numeric character was found where a numeric was expected
    error processing column TRANSACTION_DATE_TIME in row 2 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 3 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 8 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 9 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 10 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 11 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01858: a non-numeric character was found where a numeric was expected
    error processing column TRANSACTION_DATE_TIME in row 12 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 13 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 14 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month
    error processing column TRANSACTION_DATE_TIME in row 15 for datafile /home/oracle/ext_folder_test/fraud.csv
    ORA-01843: not a valid month"
    pls i need help to resolve it fast
    thank
    regards
    ajani abdulrahman olayide
    NB:
    after conversion to .csv format,
    BELOW IS THE DATA I AM TRYING TO ACCESS FROM THE EXCEL FILE
    BUSINESS OFFICE,REGIONS,Transaction_Date_Time,Report_Date_Time,Account_Key (Account No),     Number_of_Transactions,Total_Amount (N)      
    1,162,9 ojo street,Lagos South,various ,17/01/10,16200388749987,1,5100000,CHEQUE
    2,0238,"10 cyril Road, Enugu",East,21/06/2006,23/12/10,020968765357 09867653920174,1,20000000
    3,0127,"261, obiageli Rd, Asaba",Mid-West,22/12/2010,23/12/10,'00160030006149,1,6000000
    4,0519,"just road, Onitsha
    ",East,12/03/2010,14/02/11,0896002416575,1,5000000
    5,0519,"just road, Onitsha
    ",East,03/12/2010,14/02/11,06437890134356,1,5000000
    6,149,olayide street,Lagos South,10/02/2010,17/02/11,NGN01492501036 ,1,6108950
    7,0066,wale,Mid - west,18/02/2011,18/02/10,'05590020002924,1,55157977.53
    8,66,john,Mid- west,11/03/2010,14/03/09,'00660680054177,1,6787500
    9,0273,waheed Biem,N/Central,Jan 09 to Dec 2010,01/04/11,Nil,1,14146040

    As others suggested, you have to do the debugging yourself, To avoid the date error you may need something like this:
    CREATE TABLE EMPFRAUD_TEST
        SERIAL_NUM   VARCHAR2(10),
        BRANCH_CODE  VARCHAR2(10),
        BUSINESS_ADD VARCHAR2(100),
        REGIONS      VARCHAR2(50),
        TRANSACTION_DATE_TIME DATE ,
        REPORT_DATE_TIME DATE ,
        NO_OF_TRANS     VARCHAR2(50),
        AMOUNT          NUMBER,
        FRAUD_TYPE      VARCHAR2(25),
        IMPACT_CATEGORY VARCHAR2(10)
      ORGANIZATION EXTERNAL
        type oracle_loader default directory saubhik
        access parameters
        ( records delimited by newline
          badfile 'empfraud%a.bad'
          logfile 'empfraud%a.log'
          skip 1
          fields terminated by ','
          optionally enclosed by '"' ltrim
          missing field values are null
           ( serial_num ,
             branch_code ,
            business_add ,
            regions ,
            transaction_date_time date "dd/mm/rrrr",
            report_date_time date "dd/mm/rr",
            no_of_trans ,
            amount ,
            FRAUD_TYPE ,
            IMPACT_CATEGORY ) ) LOCATION ('fraud.csv')
      REJECT LIMIT UNLIMITED
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Need help at date format while creating External Tables from Flat file

    Hi All,
    I have a flat file generated from SQL Server 2005. In that generated flat file the date format is in the format as "YYYY-MM-DD HH24:MI:SS.Millisec" like example "2007-09-08 13:32:36.568".
    My task is I have to load this flat file data into Oracle database table running on 9i, but its failing at the creation of external table itself because of this date format. The target table in Oracle the date column data type is "date" only not the "TIMESTAMP".
    Can any body suggest how to resolve this?
    Thanks,
    Sankar

    Or:
    SQL> select cast(to_timestamp('2007-09-08 13:32:36.568',
      2                  'yyyy-mm-dd hh24:mi:ss.xff') as  date) dt
      3  from dual;
    DT
    08-SEP-07                                                                                                                                                                                                                                                                                                                                                                   

  • Error while loading  data into External table from the flat files

    HI ,
    We have a data load in our project which feeds the oracle external tables with the data from the Flat Files(.bcp files) in unix.
    While loading the data, we are encountering the following error.
    Error occured (Error Code : -29913 and Error Message : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: un) while loading data into table_ext
    Please let us know what needs to be done in this case to solve this problem.
    Thanks,
    Kartheek

    Kartheek,
    I used Google (mine still works).... please check those links:
    http://oraclequirks.blogspot.com/2008/07/ora-29400-data-cartridge-error.html
    http://jonathanlewis.wordpress.com/2011/02/15/ora-29913/
    HTH,
    Thierry

  • Create multiple external tables from same flat file ?

    using oracle 10g
    currently create many external tables like so..
    CREATE TABLE "XT_UNITS"
    "Q1_2012" VARCHAR2(25 BYTE),
    "Q2_2012" VARCHAR2(25 BYTE),
    "Q3_2012" VARCHAR2(25 BYTE),
    "Q4_2012" VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "XE_FILES" ACCESS PARAMETERS ( records delimited BY newline
    skip 1 fields terminated BY ',' OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES
    ARE NULL ) LOCATION ( 'xtunits.csv' ))
    is there any way I can use 1 flat file (csv) to populate many external tables ?
    maybe by section ?

    Jay wrote:
    using oracle 10g
    currently create many external tables like so..
    CREATE TABLE "XT_UNITS"
    "Q1_2012" VARCHAR2(25 BYTE),
    "Q2_2012" VARCHAR2(25 BYTE),
    "Q3_2012" VARCHAR2(25 BYTE),
    "Q4_2012" VARCHAR2(25 BYTE)
    ORGANIZATION EXTERNAL
    TYPE ORACLE_LOADER DEFAULT DIRECTORY "XE_FILES" ACCESS PARAMETERS ( records delimited BY newline
    skip 1 fields terminated BY ',' OPTIONALLY ENCLOSED BY '"' MISSING FIELD VALUES
    ARE NULL ) LOCATION ( 'xtunits.csv' ))
    is there any way I can use 1 flat file (csv) to populate many external tables ?
    maybe by section ?Not a logical question.
    An external table definition relates to one or more files.
    You could probably create multiple externable table definitions to access the same file(s), but you may end up with some operating system file locking issues if you're not careful, and to be honest why would you need to do that?

  • Reading through external tables

    How can I read multiple .csv files kept at a location into one external table.
    eg:
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    In the above example I read the file "file.csv"
    I have a directory where this file "file.csv" is kept.
    I have many such files kept in the same directory and these files are kept by some other entity and i dont know the names of all the files and also not hte number of files. I only know that these are .csv files
    Is there any way in which I can read all the files , something like wildcard as *.csv or anything else.
    thanx in advance!!!
    Edited by: Commander on Dec 4, 2008 10:39 PM

    you can you the following command to get all the list of csv files in the folder.. like
    ECLARE
    pattern VARCHAR2(1024) := '/u01/oracle/admin/SID/udump';
    ns VARCHAR2(1024);
    BEGIN
    SYS.DBMS_BACKUP_RESTORE.searchFiles(pattern, ns);
    FOR each_file IN (SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT WHERE FNAME_KRBMSFT LIKE '%.trc') LOOP
    DBMS_OUTPUT.PUT_LINE(each_file.name);
    END LOOP;
    END;
    Note: it only available in 10g
    Reference: http://www.chrispoole.co.uk/tips/plsqltip2.htm  Then you can use dynamic sql to create a external table or only alter the location of the csv file..

  • Dynamic reading headers external table

    Hi,
    I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this process by loading or quering these files as an external table.
    Evey imported database has a different layout, columns etc. Also the number of columns are very high, about 80. Is there any way to dynamically read the file to be imported to extract the column names and map them as input for the create table for the external file? After that it's more easy to query that external file. In the current situation I have to create the table manually and that takes a lot of time.
    Or does anyone have a suggestion for another import proces with sqlloader, datapump, or....?
    Thanks,
    Paul

    Paul van Rixel wrote:
    Hi,
    I have a lot (over 200) of different databases (acces, filemaker, excel, etc) which should be converted to Oracle. An application import (not Oracle) module exists but that application is very slow in importing. I wants to try to speed up this process by loading or quering these files as an external table.
    Evey imported database has a different layout, columns etc. Also the number of columns are very high, about 80. Is there any way to dynamically read the file to be imported to extract the column names and map them as input for the create table for the external file? After that it's more easy to query that external file. In the current situation I have to create the table manually and that takes a lot of time.
    Or does anyone have a suggestion for another import proces with sqlloader, datapump, or....?
    Thanks,
    PaulThere is no way to dynamically read the file to be imported to extract the column names for an external table - the names must be hard-coded.
    This may be doable in a different way, however, depending on how much work you want to do and pain you're willing to endure to accomplish it.
    The easiest way is probably have a different external table for each layout with the proper definitions.
    Doing this dynamically might be possible but will probably be harder. Dynamic solutions can range from PL/SQL/Java/whatever procedures to read, parse, collect, and insert the data dynamically using data embedded in the files themselves. This will be very hard. Possiblities include using UTL_FILE and possibly pipelined functions which can use UTL_FILE internally defining table output externally.
    Some tools offer GUI interfaces to manual file loading. Apex, for instance, can read and load a file derving column names from the first record. Perhaps this is something like what you want to do
    Good luck!

  • DATE fields and LOG files  in context with external tables

    I am facing two problems when dealing with the external tables feature in Oracle 9i.
    I created an External Table with some fileds with the DATE data type . There were no issues during the creation part. But when i query the table, the DATE fields are not properly selected though the data is there in the files. Is there any ideas to deal with this ?
    My next question is regarding the log files. The contents in the log file seems to be growing when querying the external tables. Is there a way to control this behaviour?
    Suggestions / Advices on the above two issues are welcome.
    Thanks
    Lakshminarayanan

    Hi
    If you have date datatypes than:
    select
    greatest(TABCASER1.CASERRECIEVEDDATE, EVCASERS.FINALEVDATES, EVCASERS.PUBLICATIONDATE, EVCASERS.PUBLICATIONDATE, TABCASER.COMPAREACCEPDATE)
    from TABCASER, TABCASER1, EVCASERS
    where ...-- join and other conditions
    1. greatest is good enough
    2. to_date creates date dataype from string with the format of format string ('mm/dd/yyyy')
    3. decode(a, b, c, d) is a function: if a = b than return c else d. NULL means that there is no data in the cell of the table.
    6. to format the date for display use to_char function with format modell as in the to_date function.
    Ott Karesz
    http://www.trendo-kft.hu

  • To upload a file from client machine to server machine

    Hi everybody!
    Could anyone plz help me. I am struck in a problem
    I want to transfer a file from client's machine to server but I am not able to upload
    It is tranferring the file only to the local machine
    I am using orielley package It is transferring files only to my local machine but not to the server .Can anyone correct it. It's very urgent
    how to write the relative path for server
    I am using this path and it is not uploading
    MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
    Here is my code:
    <%@ page import="java.util.*" %>
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="com.oreilly.servlet.MultipartRequest"%>
    <%
    try {
    // Blindly take it on faith this is a multipart/form-data request
    // Construct a MultipartRequest to help read the information.
    // Pass in the request, a directory to saves files to, and the
    // maximum POST size we should attempt to handle.
    // Here we (rudely) write to the server root and impose 5 Meg limit.
    MultipartRequest multi = new MultipartRequest(request, "../<administrator>:<dev2daask>@dev2:C:/123data/", 5 * 1024 * 1024);
    out.println("<HTML>");
    out.println("<HEAD><TITLE>UploadTest</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<H1>UploadTest</H1>");
    // Print the parameters we received
    out.println("<H3>Params:</H3>");
    out.println("<PRE>");
    Enumeration params = multi.getParameterNames();
    while (params.hasMoreElements()) {
    String name = (String)params.nextElement();
    String value = multi.getParameter(name);
    out.println(name + " = " + value);
    out.println("</PRE>");
    // Show which files we received
    out.println("<H3>Files:</H3>");
    out.println("<PRE>");
    Enumeration files = multi.getFileNames();
    while (files.hasMoreElements()) {
    String name = (String)files.nextElement();
    String filename = multi.getFilesystemName(name);
    String type = multi.getContentType(name);
    File f = multi.getFile(name);
    out.println("name: " + name);
    out.println("filename: " + filename);
    out.println("type: " + type);
    if (f != null) {
    out.println("length: " + f.length());
    out.println();
    out.println("</PRE>");
    catch (Exception e) {
    out.println("<PRE>");
    out.println("</PRE>");
    out.println("</BODY></HTML>");
    %>

    you have not understood my point
    how does this code will run on servlet when I want to upload a file from client's
    machine to server machine
    what I am doing is I am giving an option to the user that he/she can browse the file and then select any file and finally it's action is post in the jsp form for which I have sent the code
    All the computers are connected in LAN
    So how to upload a file from client's machine to server's machine
    Plz give me a solution

Maybe you are looking for