User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 392,001 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,177 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 969 | Replies: 4
Reply
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Help Text Or Binary

  #1  
Jul 31st, 2006
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
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2004
Posts: 715
Reputation: Phaelax is on a distinguished road 
Rep Power: 6
Solved Threads: 28
Phaelax Phaelax is offline Offline
Master Poster

Re: Text Or Binary

  #2  
Jul 31st, 2006
I would go ahead and use the FileInputStream, I just think it'll be easier.
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 191
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Text Or Binary

  #3  
Aug 1st, 2006
FileInputStream is readonly, FileOutputStream is writeonly...

And those won't cover a scenario where you don't have a drivemapping to the remote site, you'll need a network stream wrapped around it as well for the correct protocol.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Help Re: Text Or Binary

  #4  
Aug 1st, 2006
Hi everyone,

Originally Posted by jwenting
FileInputStream is readonly, FileOutputStream is writeonly

Yes sorry i meant FileOutputStream, it was a typo

Originally Posted by jwenting
And those won't cover a scenario where you don't have a drivemapping to the remote site, you'll need a network stream wrapped around it as well for the correct protocol.


Assuming that i have already gotten what you mention above all covered, do i need to transfer tags by tags or is the FileoutputStream sufficient.

Hoping to hear from you

Yours Sincerely

Richard West
Last edited by freesoft_2000 : Aug 1st, 2006 at 2:44 pm.
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,646
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 191
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Text Or Binary

  #5  
Aug 1st, 2006
You will need a ByteArrayOutputStream linked to your FileOutputStream.
That you can link to the network port and dump the content of the file as a stream, the content of the file is then completely irrelevant.
42 Private messages asking for help will be ignored
In the frozen land of Nador they were forced to eat Steve's iMinstrels, and there was much rejoicing.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 10:08 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC