How to send a document in net.HTTP.request as a POST variable?

I have read and reread the doc on net.HTTP.request, and it says I can pass an argument of oRequest, but I have not succeeded at passing in the current document, which is what I want to do.
I've tried app.activeDocs[0], or encoding that to a string, but though it makes the call without error, nothing is sent.
Should oRequest be simply a document, or a variable made up of name-value pairs? How do we send multiple parameters to a POST otherwise?
I've succeeded fine with calling using GET, but when I tried to pass the document as a GET variable, I got nothing either.
I'm sending to a LiveCycle REST end point so either POST or GET is fine.
Thanks!

POSTing the current document is straightforward *provided* your script is running outside the document context (i.e. in the console or a folder-level script). There's no access from doc-level scripts for obvious reasons.
For example, putting this in the JS console will POST the current file to a URL:
Net.HTTP.request({
  cVerb:'POST',
  cURL: 'http://localhost/submit.php',
  oRequest: Collab.documentToStream(this),
  oHandler: {
    response: function (msg, uri, err) {
       if (err!=undefined) app.alert(msg);
Your problem with talking to a vanilla webservice is that you cannot send the RFC1867 delimeters (i.e. form a "multipart/form-data" request) as the ReadStream object doesn't have a concatenation method in the Acrobat JSAPI. That's also how you would usually prepend other form fields, but if you're careful with your server-side coding you can send those as GET parameters in cURL. Normally you'd be polite and pass a Context-Type header in the aHeaders array - it won't matter to the transmission process but will allow your webservice to predict what the heck it's been sent.
Your webservice will then have to read the raw data. In PHP for example, you won't get anything in the $_FILES global but you can grab the PDF by reading everything from the input buffer, with the line:
$pdf = file_get_contents("php://input");
If that line was in the server script that the above JS code was aimed at, the variable $pdf will contain an exact binary copy of the currently-open document.

Similar Messages

  • How To send DMS(Documents cv01,cv03n,cv04n) from one sap system to othersap

    Hello Experts,
    I am working Document management system(CV01,cv02n,cv03n,cv04n)...
    I want to send the documents from one SAP system to Other SAP system
    Using ALE/Idocs....
    Please Help on this any sample programs....or function module....
    Thanks
    Preethi

    Hello,
    Please refer to the thread:
    How To send DMS(Documents cv01,cv03n,cv04n) from one sap system to othersap
    Best Regards, Murugesh AS

  • How to: Send any document using mail via "Right click"

    Hello-
    Does anyone know how to send a document, whether it is a Word, Eccel, Pages doc, etc. via a "Right Click" or similiar key stroke as we can on a WinPC? I am certain it is possible, and the closest commandIi have found is the "Services:Mail" drop down which is seemingly useless (i.e. I do not know how to make use of it). Any suggestions are appreciated. Thx
    MacBookPro 15"   Mac OS X (10.4.6)  

    thexr6,
    Welcome to Apple Discussions.
    Try this if you want to add an attachment to a new mail message:
    1. Open Automator.
    2. In the Library column, click on Mail.
    3. In the Action column, double click on New Mail Message.
    3. In the Action column, double click on Add Attachments to Front Message.
    4. In Automator>File>Save As Plug-In...>Save Plug-in As: (Type your desired name here) Plug-in for: Finder>(Save)
    Right click on the file you wish to attach and select Automator>(your desired name).
    If you know where you actually want to send the message, enter the specific information required in step 3, and add/select "Send Outgoing Messages" after step 3.
    ;~)

  • How to send dms document as email attachemnt

    Dear Techies
    Can you share the code to send the dms document as an email attachment through abap program.
    Thanks in advance.
    regards
    Omer Humayun

    Hi Omer,
    Please have a look into SCN document http://wiki.scn.sap.com/wiki/display/Snippets/DMS+Document+send+as+email+attachment
    Send DMS Document Attachments in Mail
    Hope this helps.
    Regards,
    Deepak Kori

  • How to Send Idoc Acknowledgements back to Http sender (Http to Idoc)

    Hi
    I have scenario: Http To Idoc
    first requirment:
    i need to map xml file come from HTTP Sender to Idoc (SAP system), and need to send Idoc acknowledgements/status back to Http sender.
    second requirment:
    while mapping COM Xml file come from Http to COMMAT04 idoc into SAP system i need to to check whether corresponding material already exist in R/3 or not, if material is not exist, process should be cancelled and alert should be raised. ( i mean to say before sending COMMAT04 idoc into SAP, corresponding material should be exist already, if not alert should be send to  http sender)
    please thrown some inputs, if sombody has already done with htis....
    Thanks in Advance, and help would be appreciated..
    Thanks and Regards
    Rajesh Babu

    Just providing the specifics that Suhail has intended.
    How to handle IDOC Acknowledgements in XI.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f6d2d790-0201-0010-9382-b50b499b3fbe
    RFC Mapping Lookups:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Regards,
    Ravi
    Edited by: Ravi Kanth Talagana on Jul 7, 2008 3:32 PM

  • How to send a pdf file via http call

    Hi Experts,
    Please try to think on how you would send a file like a pdf file via the http call. You might need to convert the pdf in a character string which can be sent via http. The character string then might need to  get converted back into a pdf and saved in a file. Read through the Archive Link API guide to see how they send the body of a file.
    Please it is urgent......
    Thanks
    Basu

    so you want to push the PDF file over http to external system.
    where is pdf file stored.
    for examle if its in the clients desktop, you can use gui_upload to upload to internal tabble (type BIN) then use FM SCMS_BINARY_TO_XSTRING to conver the binary table to type string.
    then use cl_http_client class to push the file to the destination.

  • How to send a document I have scanned and renamed

    Once I have scanned the document how do I get to the document so I can email it?

    Hey @jerryshea, thanks for asking that question on the HP Forums today!
    I'm happy to see that your printer is working great and scanning properly. You say you renamed and saved the scans, but you are wondering how to send them via email/how to find them on your computer to send.
    Here is the Windows tutorial - How to Send an Email with an Attachment
    Here is the Mac tutorial - How to Send E-Mail on Your Mac
    If these tutorials are not helpful remember you can always contact your respective support companies. Windows or Mac.
    Hope this helps! Look forward to hearing back from you about how this goes!
    I worked for HP.

  • How to send a document from pages in email

    Can u send a document from pages in email that can be opened by a PC.

    Ourdream wrote:
    even if I dont have word it can be sent as word?
    Yes, try Share > Send Via Mail

  • How to send a document to multiple signers

    In this tutorial, learn how to send an agreement to multiple unique signers who are signing the same agreement.

    Ourdream wrote:
    even if I dont have word it can be sent as word?
    Yes, try Share > Send Via Mail

  • SOAP Adapter Sender PI7.1: 400 Bad HTTP request

    Hello,
    I have a problem with a SOAP adapter sender communication channel.
    I'm trying to migrate a scenario from XI 3.0 to PI7.1 SP6 (PI_BASIS 2006_1_710 SAPKIPYN06).
    I can send messages successfully to the old system using the URL
        http://host:port/XISOAPAdapter/MessageServlet?channel=:BC_Name:CC_SOAP_Sender
    On PI7.1 I get
        400 Bad HTTP request
        Error: -21
        Version: 7010
        Component: HTTP_PLG
        Module: http_plgrt_mt.c
        Line: 5226
        Error Tag:
        Detail: illegal request version
    I have created a Sender Agreement, generated the wsdl from that and tried the URL in there.
    Surprisingly it has the old format, namely
        http://host:port/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_Name&receiverParty=&receiverService=&interface=myInterface&interfaceNamespace=urn:my.Interface:ns
    although the 7.1 documentation describes the ?channel=party:service:channel style only.
    Anyway, the result remains the same.
    I tried some other approaches like escaping the colons in the URL without success.
    The user has the role SAP_XI_DEVELOPER_J2EE assigned.
    Any idea what's wrong here?
    Thanks in advance
    Rainer

    >>In RWB the channel appears as "started but inactive".
    Yeah,it will be like that because you are posting messages directly to Integration server."Propose URL" does that.You are bypassing the adapter engine when you use the URL generated by "Propose URL" button.
    /people/stefan.grube/blog/2006/09/21/using-the-soap-inbound-channel-of-the-integration-engine
    The above blog gives the reason for this,if you want to bypass the adapter engine,then generate the URL as given in the above blog
    /people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
    This blog explains how to post message to adapter engine,here you need to change the URL,don't click on "Propose URL" button.You can monitor SOAP adapter in RWB only if you generate the URL as given in second blog
    The URL which is working for you in XI 3.0 is posting messages to adapter engine,so generate the URL in PI 7.1 in the same way,by following the second blog i have mentioned.
    Thanks
    Aamir

  • How to send as an email the spool request?

    Dear Experts,
    My last post was Email background schedule report to gmail or yahoo mail .
    I got solution but it's work as a notification which we can say the after report run it triggers mail that report is completed as this time.
    But i required the thing how to send a spool request of a report  as an email attachment.
    it will be in .xls or .pdf or xyz format.
    It was the additional task which was required by my organization.
    I also want to know the following things.
    1. what is sap default configuration and system behind it.
    2. what the things abaper have to check.
    3. what is bcs_examples & where do i found these bcs_example8.
    Please guide me to explore my knowledge.
    Thanks & regards
    Nayan Lad
    Note for moderator : Sir, I will close request at 2:30 pm today onward, so please do not lock it.
    Moderator Message: All your questions can be answered by searching.
    Edited by: kishan P on Nov 13, 2010 3:29 PM

    need solution..

  • How to send more than one value to the Jump target report variable screen.

    Hi,
       I have two reports with Plant variable on their input variable screens. Say this Plant can take two values X and Y. The first report is executed with Plant value X and displays data. When a jump is made  to report two, Plant value X is retrievd into report two's plant varible value. Now how to send value Y also to Report two when jump is made. I think we can do it with a customer exit? Any help is appreciated
    Thanks
    Bhanu

    Hi Bhanu,
    I guess u have created a Variable with Sinlge value ,So Create a Variable which has Multiple Sinlge Values or Interval so that u can have more than one value and if u hvae more than value u will get data for those values and when u do a jump then u can see the data in the JUMP query for both the Values of Input.
    Rgds
    SVU123

  • How to send te XML data using HTTPS post call & receiving response in ML

    ur present design does the HTTP post for XML data using PL/SQL stored procedure call to a Java program embedded in Oracle database as Oracle Java Stored procedure. The limitation with this is that we are able to do HTTP post; but with HTTPS post; we are not able to achieve because of certificates are not installed on Oracle database.
    we fiond that the certificates need to be installed on Oracle apps server; not on database server. As we have to go ultimately with HTTPS post in Production environment; we are planning to shift this part of program(sending XML through HTTPS post call & receiving response in middle layer-Apps server in this case).
    how i can do this plz give some solution

    If you can make the source app to an HTTP Post to the Oracle XML DB repository, and POST contains a schema based XML document you can use a trigger on the default table to validate the XML that is posted. The return message would need to be managed using a database trigger. You could raise an HTTP error which the source App would trap....

  • How to send delivery document from external system to ECC

    i have a business requirement to send a delivery and billing documents from external system ( MS access )  to ECC
    could any one light me how to do this ???
    Thank you in advance

    Hi Ahmed,
    Talk to your middleware team, They will upload the data through RFC.
    Basiclly RFC(Remote function call) works like it will call the function module and then upload the data.
    For more information, check the link given below.
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5b6a85b11d6b28500508b5d5211/content.htm
    Hope this helps,
    Regards,
    MT

  • How to send plain text body in HTTP Post method ?

    Hi Exeperts,
    I have a scenario http post - ptoxy. Sender sending the data in http post in plain text body (only field values will be in the body).
    how should i capture this plain text for receiver to map..
    is any udf or xsl code ?
    please guide me for achieving this requirement .
    find the attachment for http post body value.
    Regards
    Ravi

    Hi Mark,
    Thanks for your reply,
    Please share you have any udf  for this .
    can you explain me how should i map to target side.
    what are the configuration should i done in communication channel level
    Regards
    Ravinder.s

Maybe you are looking for

  • Migrating Graphs from Reports 6i to Reports 10g

    While migrating Graphs from Reports 6i to Reports 10g is there a possibility of maintaining the same graphs rather than recompiling them using the Graph Wizard of Reports 10g. I have hundreds of reports with graphs and will be an uphill task to re-dr

  • PDF/PostScript not independent of printer?

    Hi. After reading numerous posts here and elsewhere, I understand there can be issues with PDF generated from Pages. I have a specific question I would greatly appreciate any insight into: In the FILE > PRINT drop-down, what is the relationship betwe

  • Profit segment the value of the customer is coming diffrent from payer

    Hi, In Billing document(VF01) , Under the profit segment the value of the customer is coming diffrent from the payer. Would like to know how to solve this problem, Also when I checked in the document flow, even the same value exsists in the Sales Ord

  • How to lock icloud photo folder on my windows 7

    i recently have purchased an iphone 6 and am loving it. Ive set up my icloud account and realized it is nice having my photos automatically uploaded to my icloud photo folder on my pc. I am just wondering if there is any way i can put a password or l

  • More explanations about MESH and 802.11n

                       Hello, I just begin WiFi installations and I have some existential questions. I have 5 Cisco 1552-E APs. One of them is wired to LAN and act as RAP, the 4 others are MAP. On each AP, I use 1, 6, 11 channels as 2,4GHz non-overlappin