Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File to stream on request !

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a file, i can se that i on the httprequest have a methoed to get the inputsteram, but what do i do to write my txt file to the request !

Frank
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15286
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write the file to the request? Are you sure that you don't want to write it to the response?
 
Frank Jacobsen
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, im calling from a jsp a servlet, that get that takes the inputstream from the request !

But how can i write something to that inputstream !

Frank
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15286
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot write something to an input stream.

InputStream is for reading. OutputStream is for writing. What you want to do is get the OutputStream of the response object (not the request object) and write the contents of your file there.
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps Frank is asking how he can get data from the client into the input stream for reading by the server, like posting a file. Is this the case?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic