Problem when uploading CSV File

Hi, i'm testing some changes i made to an infoprovider and something strange is happening to me (as usual) I have a CSV file that is uploaded into BI from my PC and I tested this file with 100 records, later i deleted 98 records so i can test the file with fewer records in order to analyze the formulas in BEx with some very specific data. Now here is the strange part: even though i modified the file and left only 2 record in it, when I run the DTP the system is still uploading 100 records!?! How can that be possible. I checked everything, the datasource and the infopackage are both pointing to the same file (the one which has two records) and there is no other file in the entire hard drive that has 100 records and/or the same name/structure that the file i'm uploading into BI. I just can't figure out why the DTP is uploading more records that I have in the CSV file!?. Any ideas??
Another thing: I'm having problem with 0calmonth, tried everything. I put the calmonth in the CSV file in both formats MMYYYY (092010) and YYYYMM (202009) but I still get error when running the DTP. I have activated/deactivated the conversion routine in the transformation and in the datasource, I change the field length in datasource and tried any possible combination of these changes and I still can't make it work. I searched here and read all the post related to this issue but i still can't figure out how to properly upload information into 0calmonth.
Regards, Mauro

pls check the data in PSA.... you may be loading only 2 records..
Also possible that the DTP is set to load FULL data.... so its loading the entire data from PSA (old + new)
the calmonth format should be YYYYMM... what is the error message u r getting... you can always check the PSA and see whats the format coming there

Similar Messages

  • Error: java.lang.OutOfMemoryError when uploading CSV files to web server

    Hi experts,
    I have made a JSP page from which clients load csv files to web server. I am using Tomca 4.1 as my web server and JDK 1.3.1_09.
    The system works fine when uploadiing small csv files, but it crashes when uploading large CSV files.
    It gives me the following error:
    java.lang.OutOfMemoryError
         <<no stack trace available>>
    This is the code that I used to load files....
    <%
    String saveFile = "";
    String contentType = request.getContentType();
    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;
         String 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=\"");
         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 = "f:/Program Files/Apache Group/Tomcat 4.1/webapps/broadcast/file/";
         //String folder = "10.28.12.58/bulksms/";
         FileOutputStream fileOut = new FileOutputStream(folder + saveFile);
         //out.print("Saved here: " + saveFile);
         //fileOut.write(dataBytes);
         fileOut.write(dataBytes, startPos, (endPos - startPos));
         fileOut.flush();
         fileOut.close();
         out.println("File loaded successfully");
    //f:/Program Files/Apache Group/Tomcat 4.1/webapps/sms/file/
    %>
    Please can anyone help me solve this problem for me...
    Thanx...
    Deepak

    I know it may be hard to throw away all this code, but consider using the jakarta fileupload component.
    I think it would simplify your code down to
    // Create a factory for disk-based file items
    FileItemFactory factory = new DiskFileItemFactory();
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);
    // Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();
        if (item.isFormField()) {
            processFormField(item);
        } else {
            // item is a file.  write it
            File saveFolder = application.getRealPath("/file");          
            File uploadedFile = new File(saveFolder, item.getName());
            item.write(uploadedFile);
    }Most of this code was hijacked from http://jakarta.apache.org/commons/fileupload/using.html
    Check it out. It will solve your memory problem by writing the file to disk temporarily if necessary.
    Cheers,
    evnafets

  • A strange problem when uploading a file in Struts

    When i upload a file, the other elements in the form of the jsp cannot be got by the ActionForm, instead, the getters show that they are "null"s. But when i upload no file, everthing is ok.
    Moreover, the problem happens when i update an article which can have an picture with it, but when i add a new article, the problem does not appear, instead, the file can be uploaded and other element can also be got.
    i think i might be a problem of the volume of the request , because i put more information to update than to add.
    Hope someboby can help me with the problem.

    When i upload a file, the other elements in the form of the jsp cannot be got by the ActionForm, instead, the getters show that they are "null"s. But when i upload no file, everthing is ok.
    Moreover, the problem happens when i update an article which can have an picture with it, but when i add a new article, the problem does not appear, instead, the file can be uploaded and other element can also be got.
    i think i might be a problem of the volume of the request , because i put more information to update than to add.
    Hope someboby can help me with the problem.

  • Problem when opening CSV files after update

    Hello
    I have updated a Mac to OS 10.6
    Before the update, when clicking on a CSV file (bank statements) the file would open in Microsoft Excel and display all the fields in their own columns.
    Afer the update, all the fields are contained in one column. It looks like excel is not seeing the commas ? Previewing the CSV file in numbers works correctly though.
    How can I resolve this?
    Secondly, the CSV file has numbers (deposits) listed as +0000000023.99 for example. Before the update, that transaction would have showed as 23.99 in its column in excel - now it shows it as +0000000023.99.
    Any assistance would be greatly appreciated.

    This looks like an Excel issue. You didn't say which Excel version you're using. Try posting your question on Microsoft's Mactopia Office forum, but include the version and update number in your inquiry. I can tell you though that in the current Excel 2008 version, I open up csv files all the time without any problem at all.

  • Filesize a problem when uploading a file to Oracle via JDBC?

    Hello,
    I am trying to upload a file via JDBC to an Oracle Database (into a BLOB field). The file is converted to a byte array for uploading.
    While processing the request the following error is thrown :
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R Caused by: java.sql.SQLException: Datengr��e gr��er als max. Gr��e f�r diesen Typ: 485323
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at java.lang.Throwable.<init>(Throwable.java)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at java.lang.Throwable.<init>(Throwable.java)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at java.sql.SQLException.<init>(SQLException.java:52)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.ttc7.TTCItem.setArrayData(TTCItem.java:95)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.dbaccess.DBDataSetImpl.setBytesBindItem(DBDataSetImpl.java:2414)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.driver.OraclePreparedStatement.setItem(OraclePreparedStatement.java:1134)
    [31.08.05 09:58:33:151 CEST] 40cc40cc SystemErr R      at oracle.jdbc.driver.OraclePreparedStatement.setBytes(OraclePreparedStatement.java:2170)
    ("Datengr��e gr��er als max. Gr��e f�r diesen Typ" means: "Filesize bigger than maximum allowed size for this type")
    A blob is able to hold files with gigabyte size, a simple 460k file should not cause this JDBC error. I had a test with a 127k file, too, same error (different file types tested: html, doc, pdf, ...). Is this a problem of the driver or is there anythig I am doing wrong?
    Many thanks in advance for your help,
    Rommie.

    My problem is not to retrieve the file but to upload
    it. I checked the examples and only saw examples for
    retrieving a BLOB or CLOB, but not for inserting it
    into the database
    Maybe I am blind ... if so, please publish your link
    to the example.The page at:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.html
    Has a subsection that reads:
    LOB Datatype [19-Feb-2003]
    The term large object (LOB) refers to a data item that is too large to be stored directly in a database table. This sample application demonstrates how to read and write LOB datatype.The Oracle JDBC drivers provide support for two types of LOBs: BLOBs (unstructured binary data) and CLOBs (character data). BLOB and CLOB data is accessed and referenced using a locator stored in the database table.
    Download Now (ZIP, 76KB)
    Readme
    Source
    The zip is a standalone Java application that will create any needed tables, populate them with example data (both LOBs and CLOBs) from the data files in the zip and then put up a Swing gui that will allow you to add additional LOB and CLOB data to the table. Everything is there, the readme explains the 2 properties files you need to edit. The only other thing besides reading comprehension that you need to supply is DB connection information with the necessary privileges.
    The Source link is a link to the main code, but does not include all the code in the package. However, it contains the code to write CLOBs and BLOBs into the database.
    The Readme explains everything. It also has code excerpts, including the code used to read the sample data from file and write it into the LOBs and CLOBs.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/Readme.html
    Look for "loadSamples"

  • Uploading CSV file problem

    Hello everyone.
    I have a minor problem in uploading CSV file to HTMLDB.
    I don't know the exact reason, but HTMLDB threw
    "ORA-20001: Unable to create collection: ORA-06502: PL/SQL: numeric or value error" whenever I tried to upload my csv file. after a few repetition of deleting potential problem-causing columns and trying again, I found out the following:
    when numeric value and character value are stored together in single column, the upload fails. For example, we have a column which stores the employee number. The employee number is just a sequential numeric value, however temporary employees have 'T' in front of their employee number, so it begins something like T0032 and so on.
    So, then, I tried to enclose all the employee numbers which start with numeric value with " character, but that would just simply take too long to do it manually, and excel does not seem to support enclosing the values with " when it's saving the spreadsheet with CSV format.
    So, I'm kind of stuck right now.
    Can anyone give me a good way to deal it?
    THANK YOU!

    Thanks for updating my forum setting, my name is now clearly visible :-)
    anyway.. I went back and tested couple of things...
    It now appears that the problem is not caused from values inside the column... instead..
    I believe the size of csv file with certain character set is the issue here...
    This is a rough estimate, but file size larger than about 31.7 ~ 9kb caused errors IF THEY CONTAINED OTHER CHARACTER SET THAN ENGLISH.
    here are informations about my setting:
    1. Oracle database: initially 9.2.0.1 -> patched upgrade to 9.2.0.4
    2. HTMLDB: 1.4.0.00.21c (downloaded from otn)
    3. db character set : UTF-8
    4. OS: windows 2000 (with up-todate service pack and
    security patches and etc..)
    5. system: toshiba tecra 2100 with 1GB ram and 40GB hdd
    6. operation system locale: korean, south korea
    I tried uploading many other files in both english and korean, which is my national language. The english csv file worked beautifully, without any file size limitations. However, when I tried to upload a file with
    KOREAN characters in it, it failed.
    Intrigued by this behavior I started to test the file upload with various excel files, and found out that..
    1. english csv files caused absolutely no errors.
    2. engilsh file with single korean character immediately
    threw the error, if the size exceeded 31.8kb (or I
    think the size is 32kb)
    3. I tested korean file mixed english file, caused
    the same error if the size exceeded 32kb.
    the distribution of korean characters inside the
    csv file did not matter, just don't go beyond 32kb!
    Please reproduce this behavior (but I presume that some efforts will be required in order to reproduce this error perfectly, since it is not easy to obtain foreign OS in US regions.. is it?)
    anyway, thanks for your quick reply, and
    I hope this problem gets fixed, because in this manner,
    I have to split my file into 32kb chunks!
    - Howard

  • How to avoid the split problem when uploading the data from csv file

    Dear Friends,
                  I have to upload data from the .csv file to my custom table , i have found a problem when uploading the data .
    i am using the code as below , please suggest me what i have to do in this regard
          SPLIT wa_raw_csv  AT ',' INTO
                    wa_empdata_csv-status
                     wa_empdata_csv-userid
                     wa_empdata_csv-username
                     wa_empdata_csv-Title
                     wa_empdata_csv-department.
    APPEND wa_empdata_csv TO  itab.
    in the flat file i can see for one of the record for the field Title  as
    Director, Finance - NAR............there by through my code the  wa_empdata_csv-Title is getting splited data as "Director, and  Department field is getting Finance - NAR" , i can see that even though  " Director, Finance - NAR"  is one word it is getting split .
    .......which is the problem iam facing.Please could any body let me know how in this case i should handle in my code that this word
    "Director,Finance - NAR"   wil not be split into two words.
    Thanks & Records
    Madhuri

    Hi Madhuri,
    Best way to avoid such problem is to use TAB delimited file instead of comma separated data. Generally TAB does not appear in data.
    If you are generating the file, use tab instead of comma.
    If you cannot modify the format of file and data length in file is fixed character, you will need to define the structure and then move data in fixed length structure.
    Regards,
    Mohaiyuddin

  • Problem when uploading a large file in PI - weird SQL I/O errors

    Hi guys,
    I'm facing a very difficult problem when uploading a 35 MB with an FTPs adapter. I see in the logs that, after the translation to XML, it's going to 170 MB.
    I receive the following error in the CC Monitoring:
    Error: com.sap.aii.af.ra.ms.api.DeliveryException: Problem inserting 41827ca7-6b8c-4a87-198d-ad8a81fcb12b(OUTBOUND) into the database: com.sap.engine.services.dbpool.exceptions.BaseSQLException: Connection is invalid.
    When I look in the NWA Monitoring, I see the following details:
    SQL error occurred on connection affhb201:X11:SAPSR3DB: code=17,002, state="null", message="Io exception: Socket closed";
    SQL statement is "INSERT INTO "XI_AF_MSG" ("MSG_ID","DIRECTION","MSG_BYTES","TIMES_FAILED","SENT_RECV_TIME","STATUS","CONN_NAME","MSG_TYPE","REF_TO_MSG_ID","ADDRESS","TRANSPORT","CREDENTIAL","TRAN_HEADER","MSG_PROFILE","CONVERSATION_ID","SCHEDULE_TIME","PERSIST_UNTIL","FROM_P........
    I cannot check the Visual Admin Logs 'cause I don't have access to them yet.
    I'm pretty convinced that some swap memory, message size or whatever setting on the adapter engine or on the Java stack is preventing this. I do not get any message in CC Monitoring when uploading a smaller, 6 MB version of the same file.
    Can you please help me solve this or give me some interesting pointers?
    Never before did we experience something like this in the PI system. In addition, I didn't find any useful resource on the SDN and throughout the SAP notes for this.
    Let me know if you need more info about this.
    Best regards,
    George

    Hi George
    I am facing the same issue, where did you configure the message split in the Communication Channel?
    If I do the message split as you said, is it going to create several files or how does it work?
    Thanks in advanced
    Emmanuel

  • Issue when I upload CSV file for insert contact list on Cisco Attendant Console Advanced

    Hi Friends,
    I have error "Provided file is not valid CSV File" when I upload CSV file to Cisco Attendant Console Advanced system. I'm not sure what happen about my CSV. My purpose is insert contact list to system and create CSV base on documentation.
    Anyone have idea to solve this issue please kindly help me.
    Thanks

    You are right, whenever Cisco device boots, the IOS files gets loaded on the DRAM.
    But in this process, some temporary files are also generated which gets saved in the flash/Disk, that’s the only reason you got these error messages. It’s not recommended at all to have less space in the Flash than what is recommended on Cisco.com. I would say please remove some files from Disk and have minimum 256 MB flash otherwise your router may drop into rommon mode at the time of next reload.
    Well, it’s good to upgrade the bootstarp image too. Currently you are running 15.X IOS code, I would say run 15.X bootstarp image on the box.
    You may download bootstarp image for 7206VRX NPEG2 from the link below:-
    http://software.cisco.com/download/release.html?mdfid=282188585&flowid=1380&softwareid=280805685&release=15.2.4S4&relind=AVAILABLE&rellifecycle=ED&reltype=latest
    If you want to know the procedure of the upgrade, click the link mentioned below:-
    http://www.cisco.com/en/US/docs/ios/12_2/configfun/command/reference/frf010.html#wp1017654
    -Amant

  • Uploading csv file into database using apex

    Dear all
    I am using apex 4 and oracle express 10g, i need to upload .csv file into the database for one of my appls, i have referred discussion forum for solutions, i found also, but some how its not working for me.
    below mentioned is error and the code
    ERROR:
    ORA-06550: line 38, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 38, column 8: PL/SQL: Statement ignored ORA-06550: line 39, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 39, column 8: PL/SQL: Statement ignored ORA-06550: line 40, column 8: PLS-00221: 'V_DATA_ARRAY' is not a procedure or is undefined ORA-06550: line 40, column 8: PL/SQL: Statement ignored ORA-06550: line 41, column 8: PLS-00221: 'V_DATA_ARRAY' is not a proc
    Error
    OK
    CODE:
    DECLARE
    v_blob_data BLOB;
    v_blob_len NUMBER;
    v_position NUMBER;
    v_raw_chunk RAW(10000);
    v_char CHAR(1);
    c_chunk_len number := 1;
    v_line VARCHAR2 (32767) := NULL;
    v_data_array wwv_flow_global.vc_arr2;
    BEGIN
    -- Read data from wwv_flow_files
    select blob_content into v_blob_data
    from wwv_flow_files where filename = 'DDNEW.csv';
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
    -- Read and convert binary to char
    WHILE ( v_position <= v_blob_len ) LOOP
    v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
    v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
    v_line := v_line || v_char;
    v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
    IF v_char = CHR(10) THEN
    -- Convert comma to : to use wwv_flow_utilities
    v_line := REPLACE (v_line, ',', ':');
    -- Convert each column separated by : into array of data
    v_data_array := wwv_flow_utilities.string_to_table (v_line);
    -- Insert data into target table
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    USING
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4);
    v_data_array(5);
    v_data_array(6);
    v_data_array(7);
    v_data_array(8);
    v_data_array(9);
    v_data_array(10);
    v_data_array(11);
    -- Clear out
    v_line := NULL;
    END IF;
    END LOOP;
    END;
    what i understand from this is system does not identify v_data_array as array for some reasons, please help me.
    initially system was giving error for hex_to_decimal, but i managed to get this function on discussion forum and now it seems to be ok. but v_data_array problem is still there.
    thanks in advance
    regards
    Uday

    Hi,
    Mistakes in your sample I did correct
    Problem 1
    select blob_content into v_blob_data
    from wwv_flow_files where filename = 'DDNEW.csv'; to
    select blob_content into v_blob_data
    from wwv_flow_files where name = :P1_FILE;Problem 2
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    USING
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4);
    v_data_array(5);
    v_data_array(6);
    v_data_array(7);
    v_data_array(8);
    v_data_array(9);
    v_data_array(10);
    v_data_array(11);  to
    EXECUTE IMMEDIATE 'insert into TABLE_X (v1, v2, v3, v4 ,v5, v6, v7,v8 ,v9, v10, v11)
    values (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11)'
    USING
    v_data_array(1),
    v_data_array(2),
    v_data_array(3),
    v_data_array(4),
    v_data_array(5),
    v_data_array(6),
    v_data_array(7),
    v_data_array(8),
    v_data_array(9),
    v_data_array(10),
    v_data_array(11);  And I did create missing table
    CREATE TABLE TABLE_X
        v1  VARCHAR2(255),
        v2  VARCHAR2(255),
        v3  VARCHAR2(255),
        v4  VARCHAR2(255),
        v5  VARCHAR2(255),
        v6  VARCHAR2(255),
        v7  VARCHAR2(255),
        v8  VARCHAR2(255),
        v9  VARCHAR2(255),
        v10 VARCHAR2(255),
        v11 VARCHAR2(255)
      );Regards,
    Jari
    Edited by: jarola on Nov 19, 2010 3:03 PM

  • Upload csv file to sap in background

    Dear Expert,
    Please help me I want to record vendor data in background mode for this i used SHDB and has done recordings then i used gui_upload function in program and successfully uploaded CSV file without any error, then i have created session when i am running session with foreground or display error checkbox it is running correctly, as i want to run in background then i clicked on background checkbox  for process it gives information message 1 session transferred to background processing but when i am checking log there it is showing trasaction read 0, transaction processed 0, transaction with error 0, transactions deleted 0.
    Please tell me cant i upload csv file in background with this method?
    Is it manadatory to use open datset, read data set for uploading file in background?

    Hello Sir,
    During opening dataset it is opening only one record from excel file that is first row. It is not reading rest rows, I tried to used it like this...
    do 10 times.
      perform open_dataset using dataset.
      read dataset dataset into record.
      if sy-subrc <> 0.
        exit.
      endif.
      append record.
    enddo.
    First time it reads first row second time at open_dataset it is giving dump given below.
    The file "D:\vendor.csv" is already open.
    What happened?
    Error in ABAP application program.
    The current ABAP program "ZNEWTEST" had to be terminated because one of the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    Please resolve my problem....

  • Code doesn't update when uploading new files to website.

    code doesn't update when uploading new files to website.   I was using an old DW version for a long time then forced to upgrade when I bought my MacBook Pro. Now when I make changes to my pages and link to new files etc on my harddrive, when i upload the pages it won't image because the code still points to harddrive (this did not used to be a problem)... I manually changed the code on the web host site to point to the site and it loaded fine. But now my files on my harddrive also point to the web host files and now don't image on my computer. I never had to worry about this so far and wonder if the new version has a setting I'm supposed to be aware of so that I can design on my hardrive and upload and it knows that the files are being uploaded with it?  Ugh hpe this makes sense - I'm NOT a webs designer and the new DW is way more than I use in it's technology.

    Hi
    This sounds like you have not defined your site in the site definition.
    Follow the steps in these 2 tutorials to set-up your site locally and for the remote server -
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html
    http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt6.html
    PZ

  • Problem in Uploading a File by Applet

    Hi Members,
    * I have faced problem while uploading a file from client to server by ftp protocol using APPLET(No JSP) only
    * I am getting exception while running....
    * My source code is as follows,
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.io.BufferedInputStream;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    public class UploadAndDownload extends Applet implements ActionListener {
         Button upload;
         Button browse;
         TextField filename;
         File source = null;
         Label name;
         StringBuffer sb;
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
         public void init() {
              setLayout(new FlowLayout());
              upload = new Button("Upload");
              browse = new Button("Browse");
              name = new Label("Filename");
              filename = new TextField("", 45);
              add(name);
              add(filename);
              add(upload);
              add(browse);
              upload.addActionListener(this);
              browse.addActionListener(this);
         public void actionPerformed(ActionEvent evt) {
              // Code for browsing a file
              String input_file_name = "";
              if (evt.getSource() == browse)
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Select a file", FileDialog.LOAD);
                   fd.setVisible(true);
                   input_file_name = fd.getFile();
                   filename.setText(input_file_name);
                   // Gets the file from the file dialog and assign it to the source
                   source = new File(input_file_name);
                   repaint();
              // Code for Uploading a file to the server
              if (evt.getSource() == upload) {
                   // Appending the server pathname in string buffer
                   sb = new StringBuffer("ftp://");
                   sb.append("2847");
                   sb.append(':');
                   sb.append("Websphere25");
                   sb.append("@");
                   sb.append("172.16.1.111");
                   sb.append('/');
                   sb.append(input_file_name);
                   sb.append(";type=i");
                   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 from the inputstream and write it to the outputstream
                        while ((i = bis.read()) != -1) {
                             bos.write(i);
                   } catch (MalformedURLException e) {
                        e.printStackTrace();
                   } catch (IOException e) {
                        e.printStackTrace();
                   } finally {
                        if (bis != null)
                             try {
                                  bis.close();
                             } catch (IOException ioe) {
                                  ioe.printStackTrace();
                        if (bos != null)
                             try {
                                  bos.close();
                             } catch (IOException ioe) {
                                  ioe.printStackTrace();
    MY EXCEPTION IS,
    Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.net.SocketPermission 172.16.1.111:80 connect,resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.getOutputStream(Unknown Source)
         at UploadAndDownload.actionPerformed(UploadAndDownload.java:68)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)* Please let me know what problem in my code....
    * Thanks in advance....

    * Thanks for your reply....
    * I have signed my policy file by giving AllPermission and mentioned in java.security file in bin folder....
    * My question is , by giving AllPermission , can we access and do all permissions like ( SecurityPermission, AWTPermission, SocketPermission, NetPermission, FilePermission, SecurityPermission etc )...
    * My policy file is looks like follow,
    /* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
    /* DO NOT EDIT */
    grant {
      permission java.security.AllPermission;
    };* If i signed the policy like above, and when i run the applet file in InternetExplorer now , it thorws the following exception on my console,
    java.net.ProtocolException: cannot write to a URLConnection if doOutput=false - call setDoOutput(true)
         at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
         at sun.net.www.protocol.ftp.FtpURLConnection.getOutputStream(Unknown Source)
         at UploadAndDownload.actionPerformed(UploadAndDownload.java:68)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)* Please let me know , how to solve this and give me your suggestion on the above process...
    * Thanks in advance...
    Regards,
    JavaImran

  • Upload Csv files with infopackages - Error 1

    Hello again,
    i'm trying to upload csv file into a infopackage with master data text but the sistem sends a error message "Error 1 uploading external data".
    Infopackage settings:
    source system: PC
    file type: data file
    csv file
    data separator ;
    ESC signal "
    a created a txt file with data separated with ; and later converted txt file into a csv file.
    can anybody help me pls?
    Thanks
    Silvia Marques

    Hi Silvia,
    If the fields are correct in the transfer structure (only 2 fields). Then check whether the field length and type has been defined correctly for both the fields.
    If thats not a problem then try to load only upto PSA.
    If you are using IDOC as your transfer method then go to the "details" tab of the monitor of the error request and see the details. It will give you the correct picture of the error.
    Bye
    Dinesh.

  • Upload csv files with infopackages

    Hello,
    I want to upload csv files for an infopackage in BW System and when i execute the infopackage, the system sends the error message "Role for scan virus /SCET/GUI_UPLOAD is not active".
    Can anybody help me?
    Thanks
    Silvia Marques

    Hi Silvia,
    You can check OSS note: 841387. Other relevant notes are :803637, 797108 and 807989.
    Hope this helps...

Maybe you are looking for

  • E72: How to change home screen links/options?

    Hello, Is there a way to change the links/options shown under home screen ? For instance on my E72 I get following options: @Set Up e-mail <Mailbox1> <Mailbox2> ,Calendar Events WLAN scanning off Search I want to now change @Set up e-mail option with

  • Update sales Order at the time of Delivery creation

    When the Delivery gets picked and Post Goods issued , the Delivery quantity for example instead of 48,000 LBS may be little less say 47,345 LB.  We need to update this number in the order quantity which will originally have 48,000 LBS. Can we do this

  • Made an error moving iTunes Music and need to create a folder ...

    In August when I had to re-install iTunes, motherboard melt down, I thought I'd transferred iTunes Music back to the F drive, where I keep my media library, correctly. All downloads installed there and when I clicked Add Folder from my backup drive i

  • Mac OS 9 -  iTunes for iPod mini doesnt work,what do??

    last week i bought an iPod mini,but iTunes 4.7 which is on the iPod cd doesnt work (the iPod mini software also not),i think because my mac is too old. so were can i get iTunes plus the iPod mini software which runs on my macintosh?

  • Portal error - new implementation

    Hi Forum Guru's, We have just completed a new installation of PC, RM 3.0 and Netweaver portal. When we select the PC tab from within Portal, we get the following error , Portal Runtime error, an exception occurred while processing your request. Has a