aspose file tools
The moose likes Servlets and the fly likes Receiving a stream from a jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Receiving a stream from a jsp" Watch "Receiving a stream from a jsp" New topic
Author

Receiving a stream from a jsp

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Hi i am using a 3rd party library for asynch upload of a file(pic). The JS library sends the file as a data stream



How can i save this file to a physical location path(say d:\pic.jpg)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56191
    
  13

What's in file? And why are you setting the X-Requested-With header? XHR will handle that.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56191
    
  13

Technical nit: once the page gets to the browser, it's not a JSP, it's an HTML page like any other. So you are not receiving anything from a JSP, but from an HTML page.
Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Bear Bibeault wrote:Technical nit: once the page gets to the browser, it's not a JSP, it's an HTML page like any other. So you are not receiving anything from a JSP, but from an HTML page.

Thanks for correcting me. BTW its a 3rd party library and thats how it is in the code. Its a picture file. Basically i am trying to upload a picture from the HTML page asynch. and upload it to a DB.
The JS open source widget allows me to select a file and asynch. send it to the server in this case a servlet.
Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Problem solved used getInputStream from request and then used OutputStream to write to a file..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Receiving a stream from a jsp
 
Similar Threads
display of japanese characters in Excel report
Vectors passed to a static method?
Ajax works fine in HTTP but not in HTTPS in FireFox
Issue with large request data using AJAX
Pass the name of the excel through servlet