Text Or Binary

F

freesoft_2000

Hi everyone,

I do not actually have web page i can test this with but would really
appreciate anyone with experience on this topic.

You see i am trying to upload a html page called wt.html from my disk to a
website called http://www.rt.com/rf/wt.html using the HttpUrlConnection by
first authenticating myself into the server getting its outputstream and
getting rady to transfer the data.

Here is where my program begins, when a html file is involved do i
transfer the data in text form by reading the html tags one by one from
the html file on my disk and transferring the html tags one by one using
the PrintStream class

Or

can i just use the FileInputStream class to transfer the file from my disk
to the server.

For zip files and other data format, i know that i can use the
FileInputStream
and do this but for html i am not really that sure and hope that someone
can shed some light on this topic for me or anyone that has experience in
this arena as i do not actually have a webpage to test this problem with

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
O

Oliver Wong

freesoft_2000 said:
Hi everyone,

I do not actually have web page i can test this with but would really
appreciate anyone with experience on this topic.

You see i am trying to upload a html page called wt.html from my disk to a
website called http://www.rt.com/rf/wt.html using the HttpUrlConnection by
first authenticating myself into the server getting its outputstream and
getting rady to transfer the data.

Here is where my program begins, when a html file is involved do i
transfer the data in text form by reading the html tags one by one from
the html file on my disk and transferring the html tags one by one using
the PrintStream class

Or

can i just use the FileInputStream class to transfer the file from my disk
to the server.

For zip files and other data format, i know that i can use the
FileInputStream
and do this but for html i am not really that sure and hope that someone
can shed some light on this topic for me or anyone that has experience in
this arena as i do not actually have a webpage to test this problem with

Without answering the questions you asked, I'd just send the data over
as "binary". The only issue that might come up is that you'd be using a
different line-ending string on your local machine than the server expects,
but any decent web server should be able to deal with that almost
effortlessly.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top