Problem with loading file to BLOB column

I am attempting to load up a .gif gile into a BLOB column in my database.
I created the directory as below:
===
SQL> create or replace directory example_lob_dir as 'C:\temp';
Directory created.
===
Next I created the following procedure to load the file into the BLOB column:
====
create or replace procedure load_blob as
dest_loc blob; -- destination location
src_loc bfile := bfilename('example_lob_dir', 'example.gif'); -- source location
begin
-- Insert intial BLOB value
insert into test_blob(id, file_name, image)
values (1, 'test.gif', empty_blob())
returning image into dest_loc;
-- Open the source BFILE
dbms_lob.open(src_loc, dbms_lob.lob_readonly);
-- Open the LOB (optional)
dbms_lob.open(dest_loc, dbms_lob.lob_readwrite);
-- Load the file
dbms_lob.loadfromfile(
dest_lob => dest_loc,
src_lob => src_loc,
amount => dbms_lob.getlength(src_loc));
-- Close LOBs
dbms_lob.close(dest_loc);
dbms_lob.close(src_loc);
commit;
end load_blob;
===
The file is definitely in the C:\temp folder and is named correctly. I am working in WinXP with Oracle10gXE and both server and client are on the same machine.
The procedure compiles without any errors but when I attempt to run it I get an error message as below:
==
SQL> exec load_blob
BEGIN load_blob; END;
ERROR at line 1:
ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 716
ORA-06512: at "FTM.LOAD_BLOB", line 14
ORA-06512: at line 1
==
Any help would be much appreciated.

When you create objects on the database they are stored in the data dictionary by default in UPPER case.
So in this line:
src_loc bfile := bfilename('example_lob_dir', 'example.gif'); -- source location
you need to reference the name of the directory object in upper case. e.g.
src_loc bfile := bfilename('EXAMPLE_LOB_DIR', 'example.gif'); -- source location
;)

Similar Messages

  • Problem with loading file with SQL loader

    i am getting a problem with loading a file with SQL loader. The loading is getting
    terminated after around 2000 rows whereas there are around 2700000 rows in the file.
    The file is like
    919879086475,11/17/2004,11/20/2004
    919879698625,11/17/2004,11/17/2004
    919879698628,11/17/2004,11/17/2004
    the control file, i am using is like:-
    load data
    infile 'c:\ran\temp\pps_fc.txt'
              into table bm_05oct06
    fields terminated by ","
    (mobile_no, fcal, frdate )
    I hope, my question is clear. Please help, in solving the doubt.
    regards.

    So which thread is telling the truth?
    Doubt with SQL loader file wih spaces
    Are the fields delimited with spaces or with commas?
    Perhaps they are a mixture of delimiters and that is where the error is coming in?

  • Problem With Loading Files On Android

    Hi,
    I am using the below code to load video which is packaged within my app. It works fine on IOS and the desktop, but not on Android. It appears that the nativePath property is null for some reason on Android. Does anyone know the reason for this?
    thx
    var videoFile:File;
    var videoPath:String;
    var description:String = contentXml.text;
    var videoUrl:String = contentXml.media.source.(@type == "large_image");
    var videoPathStr:String = "data/cmms/images/" + cmmsAssetId + ".mp4";
    videoFile = File.applicationDirectory.resolvePath(videoPathStr);
    videoPath = new File(new File(videoFile.url).nativePath).url;

    Looks like nativePath is always null on Android... didn't see mention of that in documentation. Anyway fixed it with new File(videoFile.url).url

  • URGENT: Problems Loading files with SQL Loader into a BLOB column

    Hi friends,
    I read a lot about how to load files into blob columns, but I found errors that I can't solve.
    I've read several notes in these forums, ine of them:
    sql loader: loading external file into blob
    and tried the solutions but without good results.
    Here are some of my tests:
    With this .ctl:
    LOAD DATA
    INFILE *
    INTO TABLE mytable
    REPLACE
    FIELDS TERMINATED BY ','
    number1 INTEGER EXTERNAL,
    cad1 CHAR(250),
    image1 LOBFILE(cad1) TERMINATED BY EOF
    BEGINDATA
    1153,/opt/oracle/appl/myapp/1.0.0/img/1153.JPG,
    the error when I execute sqlldr is:
    SQL*Loader-350: Syntax error at line 9.
    Expecting "," or ")", found "LOBFILE".
    image1 LOBFILE(cad1) TERMINATED BY EOF
    ^
    What problem exists with LOBFILE ??
    (mytable of course has number1 as a NUMBER, cad1 as VARCHAR2(250) and image1 as BLOB
    I tried too with :
    LOAD DATA
    INFILE sample.dat
    INTO TABLE mytable
    FIELDS TERMINATED BY ','
    (cad1 CHAR(3),
    cad2 FILLER CHAR(30),
    image1 BFILE(CONSTANT "/opt/oracle/appl/myapp/1.0.0/img/", cad2))
    sample.dat is:
    1153,1153.JPEG,
    and error is:
    SQL*Loader-350: Syntax error at line 6.
    Expecting "," or ")", found "FILLER".
    cad2 FILLER CHAR(30),
    ^
    I tried too with a procedure, but without results...
    Any idea about this error messages?
    Thanks a lot.
    Jose L.

    > So you think that if one person put an "urgent" in the subject is screwing the problems of
    other people?
    Absolutely. As you are telling them "My posting is more important than yours and deserve faster attention and resolution than yours!".
    So what could a typical response be? Someone telling you that his posting is more important by using the phrase "VERY URGENT!". And the next poster may decide that, no, his problem is evern more import - and use "EXTREMELY URGENT!!" as the subject. And the next one then raises the stakes by claiming his problem is "CODE RED! CRITICAL. DEFCON 4. URGENT!!!!".
    Stupid, isn't it? As stupid as your instance that there is nothing wrong with your pitiful clamoring for attention to your problem by saying it is urgent.
    What does the RFC's say about a meaningful title/subject in a public forum? I trust that you know what a RFC is? After all, you claim to have used public forums on the Internet for some years now..
    The RFC on "public forums" is called The Usenet Article Format. This is what it has to say about the SUBJECT of a public posting:
    =
    The "Subject" line (formerly "Title") tells what the message is about. It should be suggestive enough of the contents of the message to enable a reader to make a decision whether to read the message based on the subject alone. If the message is submitted in response to another message (e.g., is a follow-up) the default subject should begin with the four characters "Re: ", and the "References" line is required. For follow-ups, the use of the "Summary" line is encouraged.
    =
    ([url http://www.cs.tut.fi/~jkorpela/rfc/1036.html]RFC 1036, the Usenet article format)
    Or how about [url http://www.cs.tut.fi/~jkorpela/usenet/dont.html]The seven don'ts of Usenet?
    Point 7 of the Don'ts:
    Don't try to catch attention by typing something foolish like "PLEASE HELP ME!!!! URGENT!!! I NEED YOUR HELP!!!" into the Subject line. Instead, type something informative (using normal mixed case!) that describes the subject matter.
    Please tell me that you are not too thick to understand the basic principles of netiquette, or to argue with the RFCs that governs the very fabric of the Internet.
    As for when I have an "urgent" problem? In my "real" work? I take it up with Oracle Support on Metalink by filing an iTAR/SR. As any non-idiot should do with a real-life Oracle crisis problem.
    I do not barge into a public forum like you do, jump up and down, and demand quick attention by claiming that my problem is more important and more urgent and more deserving of attention that other people's problem in the very same forum.

  • Problem with applet file loading

    I have a problem with loading files into a java applet. import java.applet.*;
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class main extends Applet {
         private static ArrayList<String> SGM;
         public void init() {
              SGM = new ArrayList<String>();
              String gameDir = getParameter("game_dir");
              try {
                   File fHandle = new File(gameDir+"game.sgm");
                   Scanner fScanner = new Scanner(fHandle);
                   while(fScanner.hasNextLine()) {
                        SGM.add(fScanner.nextLine());
                   //System.out.println(SGM.get(0));
              } catch(Exception e) {
                   System.out.println("Applet threw error: "+e);
    ...The problem is with File fHandle = new File(gameDir+"game.sgm"); I tried putting File(gameDir+"/game.sgm"); and appending / to the folder in the <PARAM> tag, but it still changes it to \, which means I can only run it locally, and in Windows. Why is it doing this, and how can I fix it?

    This file you were hoping to load: it's on the server, right? Not on the computer where the applet is running in a browser?
    (At least that's a common mistake made by people when they write their first applet.)
    If that's the case then you can't use a File object to access a file on a different computer. To access a file on the server, first you will have to put the file in a place on the server where it can be downloaded. Then in your applet you need to get a URL for the file. (The getDocumentBase() method can be used to prevent you from having to hard-code the full URL for the file.) Next, "this.getClass().getResourceAsStream(URL)" gets you an InputStream from which you can read the data from the file.

  • Problem with loading Binary Stream as image

    Hi all,
    I'm facing problem of loading Binary Stream as image.
    from source system we are getting image in XML file as string (i.e binary stream).
    Now i want to load that string again into table as BLOB. i am able to load in to BLOB column but not able to view image properly. it's giving error like "Image has not been decoded properly from binary stream".
    How can i solve this issues?
    Any help.
    thanks in advance.
    Vinay

    michali7x4s1 wrote:
    Thats a code i found somewhere, tried to check how some things work.Have you used exceptions before? If not, please read the sun tutorial on them as they are very very important. Also, whether this is your code or someone else's doesn't matter as it's yours now, and you would be best served by never throwing out exceptions as is done in this code. It's like driving with a blindfold on and then wondering why you struck the tree. It's always best to go through the tutorials to understand code before using it. If it were my project, I'd do it in Swing, not AWT. Fortunately Sun has a great tutorial on how to code in Swing, and I suggest you head there as well. Best of luck.

  • Problem with loading data to Essbase

    Hi All,
    I have a problem with loading data into Essbase. I've prepared maxl script to load the data, calling rule file. The source table is located in RDBMS Oracle. The script works correctly, ie. generally loads data into Essbase.
    But the problem lies in the fact, that after deletion of data from Essbase, when I'm trying to load it again from the source table I get the message: WARNING - 1003035 - No data values modified by load of this data file - although there is no data in Essbase... I've also tried to change the mode of loading data from 'overwrite' to 'add to existing values' (in rule file) but it does'nt help ... Any ideas what can I do?

    Below few lines from EPM_ORACLE_INSTANCE/diagnostics/logs/essbase/dataload_ODL.err:
    [2013-09-24T12:01:40.480-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received Validate Login Session request
    [2013-09-24T12:01:40.482-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received client request: Get App and Database Status (from user [admin@Native Directory])
    [2013-09-24T12:01:54.488-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: MaxL: Execute (from user [admin@Native Directory])
    [2013-09-24T12:01:54.492-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Received client request: MaxL: Describe (from user [admin@Native Directory])
    [2013-09-24T12:01:54.492-10:01] [ESSBASE0] [MLEXEC-2] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1115777344] Output columns described
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Define (from user [admin@Native Directory])
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Received client request: MaxL: Fetch (from user [admin@Native Directory])
    [2013-09-24T12:01:54.494-10:01] [ESSBASE0] [MLEXEC-3] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1102616896] Record(s) fetched
    [2013-09-24T12:01:54.496-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1116830016] Received client request: MaxL: Fetch (from user [admin@Native Directory])
    [2013-09-24T12:01:54.498-10:01] [ESSBASE0] [AGENT-1160] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1114724672] Received Validate Login Session request
    [2013-09-24T12:01:54.499-10:01] [ESSBASE0] [AGENT-1001] [NOTIFICATION] [16][] [ecid:1379989900303,0] [tid:1101564224] Received client request: Get Application State (from user [admin@Native Directory])

  • What is the exact problem with this file?

    Hi all,
    There is an old form , which was not in use from many days.
    Now when we tried to run the form, i got the error saying "FRM-40734:Internal Error:Pl/SQL error occured.", in the login form.
    When i tried to open the fmb file in Oracle Forms Builder 6i, i got the following error:
    FRM-10102: Cannot attach PL/SQL library d2kwutil. This library attachment will be lost if the module is saved., but the fmb file got open.
    The login button has the following code:
    DECLARE
      UNAME VARCHAR2(30);
      --USER_ID PARAMLIST;
      V_USER APUSERMA.USER_NAME%TYPE;
      V_PASSWED APUSERMA.USER_PASSWD%TYPE;
    BEGIN
    select user_CD INTO :GLOBAL.USER_ID from apuserma 
    where user_CD = :TI_USER_NAME AND user_PASSWD = :IT_USER_PASSWD
    AND SYSDATE BETWEEN USER_VALID_FRM AND USER_VALID_TO;
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    :global.compname := :compname;
    compnm(:compname);
    --USER_ID := CREATE_PARAMETER_LIST('USER_id_NAME');
    call_form('Forms\MAIN_SCREEN',hide,DO_REPLACE);
    exception
      when no_data_found then
      MESSAGE('Incorrect Username or Password.  Please Re-Enter');
      message(' ');
      RAISE FORM_TRIGGER_FAILURE;
    END;
    EXIT_FORM;
    When i tried to compile, i got error saying ,
    Error 201 at line 10, column 28
    identifier 'WIN_API_ENVIRONMENT.READ_REGISTRY' must be declared.
    I am not getting to know What is the exact problem with this file?
    Help me with this please.
    Thank You.
    Oracle forms builder 6i.
    Oracle 9i.

    Vijetha wrote:
    I also want to know what is the use of  win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername') ??
    What does it do??
    If i comment the following line , will it be a problem??
    :global.user_id  := substr(win_api_environment.read_registry('HKEY_LOCAL_MACHINE\system\currentcontrolset\control\computername\computername','computername'),1,10);
    Because i commented the above line & compiled, so it is not giving any error now.
    So please tell me what win_api_environment.read_registry does??
    it's read windows registry value. So, no problem if you comment it.
    Thanks

  • Beginner Has Problem With Loading JDBC Driver Using MySQL

    Hi, I am having problem with loading JDBC driver, and need your diagnotic help.
    1. I have installed MySQL (C:\mysql), created a databse (soup), and created a littel table (VIDEOS). I am able to see the table in the console:
    sql> select * from videos
    2. I have downloaded the latest version of Connector/J (mysql-connector-java-3.1.0-alpha.zip), and unzip the zip file into my C:\ directory.
    3. I copied the mysql-connector-java-3.1.0-alpha-bin.jar to the C:\j2sdk1.4.1_02\jre\lib\ext folder and it is in my CLASSPATH
    4. MySQL server is running
    C:\> C:\mysql\bin\mysqld-nt --standalone
    5. open another DOS window and use the database
    mysql>USE SOUP
    6. succesfully compiled a Java program (javac Test.java):
    import java.sql.* ;
    public class Test
    public static void main( String[] args )
    try
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    try
    Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/soup" );
    try
    Statement statement = con.createStatement();
    ResultSet rs = statement.executeQuery("SELECT TITLE FROM VIDEOS");
    while ( rs.next() )
    System.out.println( rs.getString( "TITLE" ) );
    rs.close();
    statement.close();
    catch ( SQLException e )
    System.out.println( "JDBC error: " + e );
    finally
    con.close();
    catch( SQLException e )
    System.out.println( "could not get JDBC connection: " + e );
    catch( Exception e )
    System.out.println( "could not load JDBC driver: " + e );
    7. when I run the Java program (java Test), I got
    the message:
    could not load JDBC driver: java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    What am I missing?

    Hi,
    I missed to specify test in my last post.
    Try running your program by explicitly setting the classspath when
    running your program . java -classpath c:\mysql-connector-java-3.1.0-alpha-bin.jar test
    Make sure your jar file contains org.gjt.mm.mysql.Driver class

  • Problem with Offline Files with Cisco NSS322 (firmware 1.3)

    Hi
    We've recently bought a new NSS322 NAS box to replace an ageing Windows SBS 2003 file server. We've upgraded the firmware to 1.3, and begun moving files across from the Windows server to the new NAS box. However, we're having a problem with Offline Files on the NAS, as attempting to make directories available offline on Windows clients (only tried Vista Business 32-bit so far) we get loads of errors stating that these files cannot be made available offline "because they are in use" (or something like that).
    Any suggestions as to why this might be? It doesn't appear to affect all files, but most of them.
    I've read somewhere that the "allow oplocks" setting can affect this if disabled, but it is already enabled on the device, so this can't be the cause of the problem.
    Any help you could provide would be much appreciated, as at the moment this issue is rendering our NAS unusable as we rely heavily on the offline files functionality.
    Thanks in advance.
    I have some more information - this appears to be related to the ownership permissions of the files on the NAS. New files created on the NAS can be made available offline, and have the ownership of the person who created the file, however, the files we moved across from the server are all listed as being owned by the user "guest" (I think this may be related to the fact that when we moved the files over, the user was logged in as "admin" rather than a user on the AD Domain). I should be able to resolve this through changing the owner of the files on the NAS, but I can't seem to do this, as I get an "access denied" error each time I try to change ownership.
    Message was edited by: redcitrus
    Is there any chance someone's going to be able to help me with this? I've currently spent £500 on a box that I can't use. If it can't handle Offline Files satisfactorily, it's no use to us.
    I've been looking at this a bit more - if appears that each user can make files they have created available offline, but files created by other people cannot - the error message that appears is: "The process cannot access the file because it is being used by another process".
    I'm getting desperate here...can anyone help?
    Message was edited by: redcitrus

    Sorry, but I don1 speak very good english..
    I was Try this quick test: As a quick test, you can do a forward all and make sure you can get into the ftp server.
    but result it is to same.
    I think, that problem is in firmware, becasue I know more people who own this router with to same firmware version (2.0.1.3), and have they to same problem how I.
    I have DISABLED FIREWALL on my router and problem hold over.
    If I replace router Cisco Linksys WRVS4400N by Ovislink router or any other, issue (problem) already no is.
    Configuration in Cisco Linksys WRVS4400N and configurations in any other router is to same, but FTP connection via Cisco Lynksys always will crash.
    If I connect to any other FTP server, sometimes requieres from me ftp login and password. It is OK, but if I assign login and password, after connect me to this FTP server, i see folders and files on this server, but without reason connecting fall down.
    Few seconds later if I connect to the to same FTP server, sometime either not request login and password and connection fall down.

  • Please help us, we have a problem with loading a page is slow we have to wait a longer time to open our one page, thanks in advance

    Please help us, we have a problem with loading a page is slow we have to wait a longer time to open our one page, thanks in advance

    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Problems with .ARW files and auto toning

    problems with .ARW files and auto toning
    let me try to explain this because this has happened in past and never found a way to resolve but i lived with it
    now that I have a Sony A7R the problem is more serious
    Firstly i take pride it making the picture happen all in camera, i use DRO lvl 5 to get enough light, like when i'm shooting at dusk. DRO its like doing HDR but in a single file, it lightens the darks. in my camera i'm happy with results
    but when I upload them to lightroom, they come out near black.
    allow me to explain
    lets say I import 100 images
    i double check my preferences and everything is UNCHECKED when it comes to importing options, there is no auto toning, nothing.
    as the images import i see a preview in the thumbnail which looks fine.
    i double click on one to enlarge it, hence leave grid view.
    for a brief 1 or 2 seconds, i see the full image in all its glory but than lightroom does something funny, it darkens the image
    one by one as it inspects each image, if it was a DRO image it makes it too dark.
    to make this clear, the image is perfect as it was in the beginning but after a few seconds lightroom for some reason thinks it needs to correct it.
    how to prevent lightroom from doing this, i want the image exactly as it is, why must lightroom apply a correction>?
    i think it has to do something with interpreting the raw file and lightroom applies its own algorithm.
    but here is what i dont get.....before lightroom makes the change i'm able to witness the picture exactly as it was taken and want it unchanged..
    now i have to tweak each file or find a profile for it which is added work.
    any ideas how to prevent lightroom from ruining my images and just leave them as they were when first detected...
    there are 2 phases...one is when it originally imports and they look fine
    second is scanning each image and applying some kind of toning which darkens it too much.
    thanks for the help

    sorry thats the auto reply message from yahoo email.
    i've disabled it now
    thing is, there is no DRO jpg to download from the camera
    its only ARW. so my understanding is when i use DRO setting, the camera makes changes to the ARW than lightroom somehow reads this from the ARW.
    but then sadly reverts it to no DRO settings.
    because i notice if i take normal picture in raw mode its dark but if i apply dro to it, it comes out brighter, yet when i d/l the image from camera to lightroom, which is an ARW - there are no jpgs. lightroom decides to mess it up
    so in reality there is no point in using DRO because when i upload it lightroom removes it.
    is there a way to tell lightroom to preserve the jpg preview as it first sees it.
    its just lame, picture appears perfect...than lightroom does something, than bam, its ruined,.
    what do i need to do to prevent lightroom from ruining the image? if it was good in the first place.

  • Problems with compressing  files with right hand click. it does not work.

    Problems with compressing files with right hand click.
    I am using the compress function in the Mac OS (File > Compress XX) from time to time. Today it does not work anymore. OS 10.5.6
    I get a message: The content list cannot be created for compressing.
    I tried it with files and folders and keep getting this message. Anybody any idea as to how to fix this

    Thanks I love my macbook!!!!
    I also got further problems such as copy-paste not working etc.
    so I fixed it just this morning by running Applejack 1.5 and am back up running noticing your post.
    thanks for helping though!

  • Problem with Image file

    Hi,
    Iam facing with one problem.I have one swing interface through which I can upload files(back end servlet programme).Now I can upload all types of file but problem with image file it uploading perfectly that means size of the uploaded file is ok but its format damaged.It can not be open.My backend servlet programme is ok coz i tested it with html form it is working perfectly.Problem with swing interface.Plz guide me where I done a mistake.Below r my codes:-
    ImageIcon Upload=new ImageIcon("images/Upload.gif");
         Button=new JButton(Upload);
         Button.setToolTipText("Upload");
    Button.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
              int returnVal = fc.showOpenDialog(ActionDemo4.this);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              File file = fc.getSelectedFile();
    String aa=file.getAbsolutePath();
              textArea3.append(aa);
                   textArea2.append("Local URL:");
    long l=file.length();
              try
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff);
              String str1=textArea10.getText();
    url = new URL ("http://127.0.0.1:7001/servletUpload?x="+str1);
         urlConn = url.openConnection();
         urlConn.setDoInput (true);
         urlConn.setDoOutput (true);
         urlConn.setUseCaches (false);
         urlConn.setRequestProperty("Content-Type","multipart/form-data;boundry=-----------------------------7d11e410e500f2");
         printout = new DataOutputStream (urlConn.getOutputStream ());
    String content ="-----------------------------7d11e410e500f2\r\n"+"Content-Disposition: form-data;"+"name=\"upload\"; filename=\""+aa+"\"\r\n"+"Content-Type: application/octet-strem\r\n\r\n\r\n"+conffile+"-----------------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);
    printout.flush ();
    printout.close ();
    Best Regards
    Bikash

    The errors are here:
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff); (conffile is a String object containing the image)
    and here:
    String content ="-----------------------------7d11e410e500f2\r\n"+"Con
    ent-Disposition: form-data;"+"name=\"upload\";
    filename=\""+aa+"\"\r\n"+"Content-Type:
    application/octet-strem\r\n\r\n\r\n"+conffile+"--------
    --------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);conffie is sent to the server but
    it's non possible to treat binary data as String!
    Image files must be sent as byte[] NOT as String ......

  • Problem with Receiver File adapter

    Hi
    I have a problem with receiver file FTP adapter, while writting file in target folder, connection is failing, after retries, it writting file again. How to avoid this situation, is there any way to write the leftout part in the file.
    VS

    Hi
    Thank u all,  Problem is solved, i changed write mode to Over write existing file. It is working fine.
    VS

Maybe you are looking for

  • Firefox will not open because of a "nssutil3.dll" error. How can I back up my bookmarks when Firefox will not open?

    Firefox would not open because of a "nssutil3.dll " problem. I've researched the problem, and I am using Norton 360 which is not a known antivirus program that deletes the file as a trojan. I want to uninstall and reinstall firefox, but first I want

  • 5800 Contacts problem

    Whenever i create a new msg and select one particular contact and when i search for another contact which "exists" in my list.. It doesn't appear at all !!!!.. Is this prob might be cos of sim-card? I had this prob quite recently and not on the day o

  • Camera Raw 5.2 not installing in PSE6 on Mac

    Hi, I've downloaded the update and opened it. It goes into an automatic install, skipping over "Destination Select". After it finished, I looked in the root Library/Application Support/Adobe/Plug-in/CS3/File Formats, and the only thing there is the o

  • Date format in utl_file

    hi gurus, i've a date format preblem using the utl_file approach. i can't produce a file with format of 'MM-DD-YYYY'. tried using to_char function but to no avail coz the output was still in dd-mon-yyyy pls help.. thanks Edited by: user11211113 on Ma

  • Different PO references in one (inbound) ORDRSP-IDoc possible?

    Hello all We send PO's to our vendor. Each one as individual ORDERS05-IDoc. On the vendor side multiple PO's sometimes are combined to a single sales order (SD) containing all items from our different PO's. When vendor sends us back his confirmation