- Where Developers Learn, Share, & Build Careers
I'm trying to send a picture to your Java servlet (hosted on Amazon EC2) after the Amazon S3 and how to move on surprise to retrieve the image from the POST request
Upload Code
request (pic.imageData a NSData type) thus sent via iOS RestKit API :.
Rackpromes * Parameters = [Rak paramam]; [Parameter set value: pic.dateTaken forParam: @ "dateTak"]; [Parameter set value: uploaded for pic.datePRM: @ "dateduploaded"]; [Parameter setdata: pic.imageData MIMEType: @ "Image / JPG" for: @ "image"]; [RK Client Shared Client] Username = deviceID; [RK Client Shared Client] .password = session; [RK Client Shared Client] Authentication type = RKRext attestation type HTTPBics; UploadPictureRequest = [[RK Client Shared Client] Posted: kUploadPictureServlet params: Parameters Rep: Self]; parsing code stub
This is how I parse the other two parameters to Java Servlet:
Double dateTaken = double. ParseDouble (req.getParameter ("dateTaken")); Double dateduploaded = double. PRADABB (rake jap parameter ("debtuploaded"); question
The question is:? I out how to parse image on your server lines of the but while some use:
// or @SuppressWarnings ( "unchecked") @SuppressWarnings ( "rawtypes") public void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {if (ServletFileUpload.isMultipartContent (request)) {final FileItemFactory factory = new DiskFileItemFactory (); Last servlet file upload upload = new servile file upload (factory); {Try the final list items, upload Similarities (request); For (iterator IRR = item. Inhibitor), Aiaracacas Next ();) {final Failitm items = (Failistm) Aiaraar. Xx (); If (! Item.isFormField ()) {/ * * TODO: (for you) * 1. Verify that the file item is an image type. * 2. And do whatever you want with it. *}}} Catch (file uploadException E) {e.printStackTrace (); }}} Look at the API reference doctor to determine what to do next.
Comments
Post a Comment