0

I can't save string buffer as file and send it, because I'm using elastic beanstalk. I just have a string and I need to user can download this as xml document.

router.get('/', (req, res) => {
  let xml = `<note>
                <to>Tove</to>
                <from>Jani</from>
                <heading>Reminder</heading>
                <body>Don't forget me this weekend!</body>
            </note>`;
  //What next?
});
2
  • 1
    Set the content type header to the correct one (text/xml ?) And validate your whole xml document so that you send the correct res. Commented Feb 16, 2017 at 16:32
  • @Shilly when I do that I have a screen with xml code. I need downloading file. Commented Feb 16, 2017 at 16:35

1 Answer 1

1

Add content disposition header as attachment and content type as xml

Content-Disposition: attachment
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.