-1

Right now I am passing the XML file directly. But I want it to be passed as a httpRequest as shown in the below comment

// String xmlRequest = getXMLRequest(httpRequest);
   String xmlRequest = tdFile.fileToString("C:/Users/praneel/Desktop/file.xml");

How can I do that ?

2
  • Do you mean they'll pass the path to the file on their system or do you mean something else? Feb 24, 2011 at 17:04
  • What is this question about? a) Reading a file to a string / byte array or b) creating a POST request with an attached file or c) both? What technology are you using? Feb 24, 2011 at 17:05

1 Answer 1

2

I really have to guess what you mean, but if this is about handling uploaded files on the server side, take a look at Commons/Fileupload

If you mean sending file contents to a HTTP Server, then Apache HTTPClient may be the right choice for you. See Code Examples

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.