0

I'm creating an XML file and want to send it to an external URL(that starts a PDF download) using POST method without using the form.
I have this form example that I'm trying to avoid.

  <form action="https://www.szamlazz.hu/szamla/" method="post" enctype="multipart/form-data">
  XML állomány: <input type="file" name="action-xmlagentxmlfile"><br><br>
  E-mail értesítő küldés esetén:<br>
  <input type="submit" name="generate" value="Számla generálás">

This is how I'm creating my file that I want to send.

$created_xml = ($xmlBuilder->getXML());
   file_put_contents(
        $order_id.".xml",
        $created_xml,
    );
  • You want to POST a file to a third-party site through code instead of using their form to do so? – Greg Schmidt Jul 26 '22 at 14:49
  • Does this answer your question? [PHP, cURL, and HTTP POST example?](https://stackoverflow.com/questions/2138527/php-curl-and-http-post-example) – Greg Schmidt Jul 26 '22 at 14:50
  • You could add it as a mime attachment. See : https://learn.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/aa563375(v=exchg.140) – jdweng Jul 26 '22 at 21:39
  • @GregSchmidt Yes, I want to POST a file to a third-party site through code instead of using their form. Cauze this function will be added to a commerce website and the user does not need the xml file, he directly needs the pdf – GrappwiiyOP Jul 27 '22 at 06:21
  • Then the link I provided should give you all the details you need. – Greg Schmidt Jul 27 '22 at 13:29

0 Answers0