Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6992979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:42:19+00:00 2026-05-27T19:42:19+00:00

So a form like this: <form action=/appapi/checkout/ method=post mimetype=text/xml enctype=text/xml name=form1> <input type=file name=xmlfile>

  • 0

So a form like this:

<form action="/appapi/checkout/" method="post" mimetype="text/xml" enctype="text/xml" name="form1">
<input type="file" name="xmlfile">
<br />
<input type="submit" name="Submit" value="Submit">
</form>

Will pass me a xml file to appapi/checkout/

How can I read this file? Or do I need to save it on my server before I can read it?

Like it has been done here: receive xml file via post in php

I tried to:

$url = 'php://input';

$xml = simplexml_load_file($url);

But wouldnt work out. How can i do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:42:20+00:00Added an answer on May 27, 2026 at 7:42 pm

    I’m not specifically sure that enctype="text/xml" in the <form> element will make the browser to send in the file’s content as raw input to the server. One might want to test if that’s possible, but I don’t know.

    However, you could perform a standard file upload with PHP­Docs and work on the temporary file that will be automatically created:

    $xml = simplexml_load_file($_FILES['xmlfile']['tmp_name']);
    

    This needs the form to have enctype="multipart/form-data". Also it’s wise to first check if the file was successfully uploaded by looking into $_FILES['xmlfile']['error'], it is 0 when no error occured:

    $upload = (object) $_FILES['xmlfile'];
    $xml = $upload->error ? NULL : simplexml_load_file($upload->tmp_name);
    

    BTW, the tempfile will be automatically removed when the PHP script finishes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form like this: <form name=serachForm method=post action=/home/search> <input type=text name=searchText
I have a page like this: <form class=ajax method=post action=add_item.php> [text input] [submit button]
My Form looks like this: <body> <form id=myForm method=post> <label>id:</label> <input type=text name=id id=id
I have a form like this: <form id=loginCompact action=https://externalsite... name=sportsbook method=post onsubmit=createCookie('BRLOG', document.sportsbook.username.value, 1)>
I have a html form like this : <form action=https://www.123.com/cgi-bin/action method=post> <input type=hidden name=item_name
I have a php form like this. <form name=form1 id=mainForm method=postenctype=multipart/form-data action=<?php echo $_SERVER['PHP_SELF'];?>>
I have a form like this: <form name=mine> <input type=text name=one> <input type=text name=two>
When I have a form like this: <form method=post action=.> What does the .
I have an input in Struts 2 form like this: <s:form action=Action> <input type=text
I have a form like this: <form id=form_main name=form_main action=/search/ target=iframe001 method=get onSubmit=reset_and_subm();> Enter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.