Forums Register Login

Filename as url.

+Pie Number of slices to send: Send
Hello sir,
Pl.. help me to convert file name as url that is given as

FileOutputStream output = new FileOutputStream("F:\\hello.xml");
OutputFormat format = new OutputFormat(hello);
XMLSerializer serializer = new XMLSerializer(output, format);
This file is placed in server as "http://pepsi/hello.xml"
How can i specify the url path in the o/p stream.
Pl.. help me as soon as possible.
with regards,
Sonara.
+Pie Number of slices to send: Send
You can probably do something like this
HttpURLConnection http = new HttpURLConnection("http://pepsi/hello.xml");
http.setRequestMethod("POST");
OutputStream output = http.getOutputStream();
OutputFormat format = new OutputFormat(hello);
XMLSerializer serializer = new XMLSerializer(output, format);
output.close();
this assumes that you have sufficient rights on your http server to POST data into hello.xml
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 756 times.
Similar Threads
setLineWidth() in OutputFormat class
Saving an Xml File in server
writing back to a xml file
DOM : Set Encoding from Cp1252 to UTF-8
Xml/File Input/Output
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:21:15.