Sending Binary Data using HTP package

Has anyone been successful in using the HTP package and its PUTRAW procedure to send binary data to a browser?
Example code shows basic idea:
create or replace
procedure test_raw as
output VARCHAR2(20);
begin
OWA_UTIL.MIME_HEADER('application/x-gzip', TRUE);
output := 'Hello World!';
HTP.PUTRAW(UTL_RAW.CAST_TO_RAW(output));
HTP.FLUSH;
end test_raw;
I receive an empty file when called from the browser.
What gives?

I found my answer. I should be using wpg_docload.download_file(BLOB) to "download" a the contents of a BLOB.

Similar Messages

  • Sending Binary data using ASCII

    Hello All,
    I'm trying to control serial-interface instrument using NI-VISA with a set of ASCII codes, but the instrument reads/sends binary data only. What should I do so that the ASCII codes I send are converted into binary commands for the instrument to read, and that the data I receive is converted back into ASCII?
    Thanks in advance
    M

    Hi M,
    first you should define the words "binary commands/data". Then you should know: ASCII is binary too...
    You may work with an U8 array. You can easily convert strings to U8 arrays and vice-versa!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Reading html data & uploading a file in single html form using htp package

    Hi
    I have designed a html screen using htp package in which i have few text items and file upload button. I have to validate all forms data like text items and check box elements and upload file to unix. I am using java script for file validations and cgi script to upload file. With this I am able to either read form data or upload file but not both.
    At a time I want to insert a record to database with html form values and upload file to unix with htp package. Please suggest how can I read html form data + uploading a file to unix simultaneously in a single htp procedure.
    Thanks,
    Pradeep

    Have you ever considered using Application Express (APEX)?
    Oracle Application Express (APEX)
    Sounds like you're going the long way around to create a web based application.

  • How to send binary data in the message body

    How can we send binary data in the message body that is base64 encoded? below are the requirements
    Mime Header.
    Mime-version: 1.0
    Content-Type: application/octet_stream; name=test
    Content-Transfer-Encoding: Base64
    Submission must be named "test.sub" (lowercase)
    Submission must be base64 mime-encoded
    Submission must be sent in the body of the message (not as an attachment)
    Only one submission per mail message
    No other comments should be put in the body of the mail message (other than the submission)
    I highly appreciate your help. If you can provide few examples, that will be very helpfull.
    Thanks,
    Madan

    Use Message.setContent to set the content, or use Message.setDataHandler with
    a DataHandler constructed with a ByteArrayDataSource. If the content is not
    "naturally" encoded in base64, you can enforce it by setting the Content-Transfer-Encoding
    header to "base64". Any reasonable mail reader won't care what encoding you use, as
    long as the decoded data is correct.

  • Sending binary data from JSP (1.1)

    Hi all:
    I am using Tomcat 3.2.1 and Apache under Linux Mandrake OS.
    I have a JSP (1.1) sending binary data (GIF, PDF, DOC ..) using response.getOutputStream().write(data)
    method.
    The problem is the precompiler automatically creates the JspWriter and puts some out.write("\r\n") lines
    before I use getOutputStream method. The JVM throws an IllegalStateException because I am using both
    methods (this is from Servlet 2.2 specification).
    Must I change my code to forwarding to a servlet that make this work or is there a simple solution to
    avoid this?
    Thanks in advance.
    J.
    null

    Hi Shreeharsha
    Please refer to below docs for sending data from JSP page to RFC. In which you need to use sap connectors for connecting to SAP backend system.
    http://help.sap.com/saphelp_nw04/helpdata/en/b6/55e3952a902447847066a0df27b0d6/content.htm
    Hope it helps
    Regards
    Arun

  • Sending binary data over RS232 without conversion to ascii

    I need to send binary data to a PIC without the data being converted to ascii. With the VISA vi's, when I want to send 11111111, it gets converted to a string "255", and is sent as "2","5","5" in ascii.
    How can I send it as one byte?

    r_keller wrote:
    @tbob: I probably shouldnt tell my customer that he's an idiot, and obviously 9 bit addressing/signalling modes seem to be not so uncommon in industry, so ur post does not really contribute to solve the problem.
    Well I wouldn't call my customer an idiot either.  I didn't know he was your customer.  Sorry.  Not every comment posted here is intended to directly solve a problem.  We are a fun loving group, and occasional ribbings take place here.  I still think that trying to use 9 bits over an 8-bit protocol is not a good way to go.  But if it is the only way, then so be it.
    r_keller wrote:
     Does the Mark or Space parity bit add another 10th bit to the command or can i only use either ODD parity/Mark/Space?
    According to the link you attached, the parity bit adds only one more bit.  If the number of bits is set to 8, then the parity is the 9th bit, and you can only use Mark or Space to force that 9th bit to either 1 or 0 respectively.  If you try to use odd or even parity, the protocol will determine the parity and change the bit accordingly, and it may not be the one you intended to send.  The start and stop bits are fixed by the protocol and cannot be used for extra data bits.
    Actually, until I read that article about using Mark and Space, I had no idea at all that sending 9 bits at a time was possible.
    - tbob
    Inventor of the WORM Global

  • Error while sending the data using input schedule

    Dear Friends,
    I am unable to send the data using input schedule due to following error is occur while sending the data.
    The Error Message : Member (H1) of dimension (ENTITY) is not a base member (parent or formula)
    Can anyone please help me to resolve the above error.
    Thanks and regards,
    MD.

    Hi,
    You are trying to send data to a parent/node, you can only send data in BPC to lowest-level children (base mamabers) of any dimension.
    "H1" is a parent in the entity dimension so you should try sending to a child.
    Tom.

  • Tcode to send custom data using custom message type in ALE

    I have ceated custom message type and i want to send data to say system B.I wanted to know Tcode to send custom data using custom message type in ALE.
      for example:
    material data...message type = matmas....tcode = BD10.
    like this.
      i hope you have got my question.
    plz guide me?
       regards
         mallikarjun mangalore

    Hi,
    Sending data through ALE is not a single-step process. Take a look at http://www.sapgenie.com/ale/. The paper at http://www.sapgenie.com/sapgenie/docs/ale_whitepaper.doc is a wonderful resource for the ALE process.
    Regards

  • Using a servlet to send binary data

    There is a section of our intranet that need to hold documents that have to be available only for a certain group of users. Here's my approach (if you think of a better one, please tell me):
    1-all the files are in a directory upper than WWWRoot so that nobody can directly download them
    2-there is a servlet that first: authentificate the user with username-password; and then lists all available documents.
    3-When one of these docs is clicked, I want my servlet to open the file using filesystem File object and then copy the content of the selected file in the http response body. What object and method should I use to do so? I dont know if I should use FileReader or something else. Dont forget it will not only has to work with text files, but also with binary data files like swf, powerpointpresentation and the like. So I fear that objects such as FileRead will mess special characters up and corrupt data.
    What would you advice me? Use FileReader or another object? Or maybe a completly different approach for the problem? And if you want to give me some sample codes, it would be appreciated.
    Thx for your help

    There is something I dont understand.. its bizarre. Usually I dont understand why a script is not working, but now, I dont understand why a scritp is working..
    Here are the codes that copy from a file to the servlet's ouput:
    //basic response configurations
    response.setContentType( mimeType );
    ServletOutputStream out = response.getOutputStream();
    //copy a file f to the servlet's output stream
    File f = new File( path );
    FileInputStream fis= new FileInputStream(f);
    int available = fis.available();
    byte[] b = new byte[available];
    fis.read(b);
    out.write( b );
    out.flush();
    They work fine. What I dont understand is that I tried them with a file of about 5 megs, and they still worked! I expected them to fail because the variable available is of the type int and then it implies that the maximum file size permitted by the algorithm should be 65536 bytes/1024=64 ko... isn't it????

  • Sending binary data as attachment

    Is that possible to send binary ( which is actually fragment of a large file i.e. 100MB ) data as attachment to SOAP message ?
    The complete scenario is below.
    * I have to send a large file around 100MB, to server as a fragment as attachment of SOAP message.
    * It is received at the server and sent as such to another server ( I dont want the user to send data directly to this "another" server, call it as main server ).
    * main server will update the fragment into a stream which remains unclosed until last fragment received.
    * after receiving SOAP message ( which contains the fragment ), main server will repond 'OK' to sub server.
    * If the sub server receives OK, then it will send the next fragment until EOF.
    May be at main server I may need to check whether the file is properly received using some checksum logic.
    I hope I am making sense. I am thinking of using Axis2 ( I am totally newbie to web services). Could someone point me if I miss something ?

    thanks

  • Java proxy to send binary data

    Hi guys,
    I needed a small clarification.
    I'm using java proxy sender and file receiver in a scenario. I want to pick up binary files (i.e. the file could be of any format text,zip,pdf, image etc) using jakarta commons api to connect to ftp and then call the proxy to send this file data via proxy.
    I'm not clear on how this requirement can be achieved or it can be achieved or not.

    Hi Stefan,
    I'm referring to the comments given by Michal in the below blog.
    [How to send any data (even binary) through XI, without using the Integration Repository|How to send any data (even binary) through XI, without using the Integration Repository]

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • Reg : Sending Binary data as output in GP

    Hello ,
    I developed one webdynpro Project it has interactive adobe form ,  in Guided procedures
    created CO for Webdynpro Componet(GP interface) for this form and created GP inerface also.
    But in this callable object the Requestor creates new pdf form.This PDF(means interactive form is taken as binary for pdfsource )  form has binary data.
    *How to send this binary data as output in GP. *
    Please help me out.
    Thanks
    Risha

    thanks

  • Displaying image from binary data using java

    hi there,
    i have created a swing applet displays me a url, what the url returns me is the image in binary format, and i want to show the complete image using that binary data
    so how do i do it.
    some thing like this :
    URL url = new URL("http://192.168.1.1:8086/file-storage/download/Zerg.jpg?version_id=35688");
    JEditorPane jep = new JEditorPane();
    jep.setPage(url);
    output is in binary on my applet window.

    Hey,
    This displays an image from a url, you could check if your url is and image or not using URL.getFileName() and see if it ends in gif jpeg etc. and then display it this way.
    hope it helps
    Nick Hanlon
    import java.awt.*;
    import java.awt.Image.*;
    import java.awt.Toolkit.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.html.*;
    public class SimpleApp extends JFrame {
    public static void main(String args[]) {
    SimpleApp aFrame = new SimpleApp();
    public SimpleApp() {
    super("Frame");
    /*JEditorPane jep = new JEditorPane();
    jep.*/
    try {
    HTMLEditorKit htmlKit = new HTMLEditorKit();
    JEditorPane ep = new JEditorPane();
    try {
    ep.setEditorKit(htmlKit);
    BufferedReader in = new BufferedReader(
    new StringReader(
    "<HTML><IMG SRC=\"http://developer.java.sun.com/images/chiclet.row.gif\"></HTML>"));
    htmlKit.read(in, ep.getDocument(),0);
    getContentPane().setLayout(new BorderLayout());
    setResizable(false);
    getContentPane().add(ep, "North");
    pack();
    show();
    } catch (javax.swing.text.BadLocationException e) {}
    } catch (IOException e) {}
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    }

  • Sending Table data using  RFC as a Web services

    Hi guys,
      I want to send ztable data from CRM system using RFC as a web service , but i want to read records only for a particular date and time , so how can i go about this scenario.
    regards;Keith.

    Hi Keith,
    for that scenario you need two RFC adapter. Of course you can use as well proxies as dicussed before. Forget about webservices.
    You told me above that you have z-table? add a date/time field and if a set will be inserted fill those fields with sy-datum / sy-uzeit.
    Your CRM select can now easy select only the actual data.
    Because of performance i would recommed a asynchron scenario, for example:
    A ABAP programm is selecting the data and is calling a module like
    CALL function 'myFunction'
    DESTINATION 'mySM59'
    IN BACKGROUND TASK
    This function module is build anywhere and imported into Repository and is working a outbound interface. Inbound interface is a second function module, which is imported from R/3. The ABAP source code of that module put the data to SAP system.
    The CRM ABAP programm will be called periodicly by a job.
    But!! I dont know ur requirements. Unfortunately you are one of thesse persons, who are asking without giving details. I'm not the prophet...
    Regards,
    Udo

Maybe you are looking for