1 Reply Latest reply on Nov 10, 2009 2:51 AM by ludovicalchi

    How to upload file in Oracle XML DB/Oracle Database

    Andrew Shakula
      Hi, all.
      Anybody knows how to upload file in Oracle XML DB/Oracle Database. I use FileReference class for uploading. But Oracle returns HTTP/1.1 400 Bad Request. When upload file through html page all work fine.
      HTTP stream when upload from html page:
      POST /dss/hp_dss_upload_file2 HTTP/1.1
      Accept: */*
      Referer: http://10.120.120.20/dss/hp_dss_upload_form2
      Accept-Language: uk,en-us;q=0.5
      Content-Type: multipart/form-data; boundary=---------------------------7d7cb36c076a
      UA-CPU: x86
      Accept-Encoding: gzip, deflate
      User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.2)
      Host: 10.120.120.20
      Content-Length: 203
      Connection: Keep-Alive
      Cache-Control: no-cache
      Authorization: Basic YXNoYWt1bGE6TGVpbmVyMjAwNg==

      -----------------------------7d7cb36c076a
      Content-Disposition: form-data; name="Filedata"; filename="D:\1\2.txt"
      Content-Type: text/plain

      "test string"
      -----------------------------7d7cb36c076a—
      HTTP stream when upload from Flex application:
      POST /dss/hp_dss_upload_form2 HTTP/1.1
      Accept: text/*
      Content-Type: multipart/form-data; boundary=----------Ij5ei4KM7cH2cH2ae0Ef1GI3gL6gL6
      User-Agent: Shockwave Flash
      Host: 10.120.120.20
      Content-Length: 421
      Connection: Keep-Alive
      Cache-Control: no-cache
      Authorization: Basic YXNoYWt1bGE6bGVpbmVyMjAwNg==

      ------------Ij5ei4KM7cH2cH2ae0Ef1GI3gL6gL6
      Content-Disposition: form-data; name="Filename"

      2.txt
      ------------Ij5ei4KM7cH2cH2ae0Ef1GI3gL6gL6
      Content-Disposition: form-data; name="Filedata"; filename="2.txt"
      Content-Type: application/octet-stream

      "test string"
      ------------Ij5ei4KM7cH2cH2ae0Ef1GI3gL6gL6
      Content-Disposition: form-data; name="Upload"

      Submit Query
      ------------Ij5ei4KM7cH2cH2ae0Ef1GI3gL6gL6--