Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Sending multiple files to a servlet with a single connection -


i'm writing java desktop client send multiple files on wire servlet using post request. in servlet i'm getting input stream request receive files. servlet write files disk, 1 one they're read stream.

the implementation has couple of requirements:

  • only 1 http request must used server (so single stream)
  • the servlet must use reasonable fixed amount of memory, no matter size of files.

i had considered inserting markers stream know when 1 file ends , next 1 begins. i'd write code parse stream in servlet, , start writing next file appropriate.

here's thing... surely there's library that. i've looked through apache commons , found nothing. commons file upload interesting since upload comes java app, not browser solves receiving end, not sending.

any ideas library allows multiple file transfers across single stream fixed memory expectations large files?

thanks.

just use http multipart/form-data encoding on post request body. it's described in rfc-2388 , standard way of uploading (multiple) files http.

you can java.net.urlconnection described in mini-tutorial, although generate lot of boilerplate code. more convenienced approach using apache commons httpclient.

in servlet side can use apache commons fileupload process uploaded files usual http way (or when you're on servlet 3.0, httpservletrequest#getparts(), see this answer examples).


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -