multipart

Receiving multipart POST data requests in PHP

I want to receive the following HTTP request in PHP: Content-type: multipart/form-data;boundary=main_boundary --main_boundary Content-type: text/xml <?xml version='1.0'?> <content> Some content goes here </content> --main_boundary Content-type: multipart/mixed;boundary=sub_boundary --sub_boundary Content-type: application/octet-s...

Multipart response in Ruby/Rack

I want my server to send a multipart response (multipart/x-mixed-replace). I'd prefer some kind of solution using the Sinatra framework or a generic Rack app, but any example in ruby would be nice. Here's the equivalent of what I'm trying to do, in PHP: <?php header('Content-type: multipart/x-mixed-replace;boundary="rn9012"'); prin...

Java: Receive a multipart HTTP response

I'm writing a Java client application to receive live M-JPEG video from an IP camera. The video is sent by the camera as an endless multipart HTTP message where each part is a single JPEG frame. I need to process each of these frames as they arrive, so I'm hoping there's a way to make an HTTP request that asynchronously triggers an event...

How should I serve ZIPped webpages?

Background: Our software generates reports for customers in the usual suspect formats (HTML, PDF, etc.) and each report can contain charts and other graphics unique to that report. For PDFs everthing is held in one place - the PDF file itself. HTML is trickier as the report is basically the sum of more than 1 file. The files are availabl...

Can a long file upload be handled by a cluster of (Tomcat) servers where in if one server fails/crashes during the upload, another one picks it up

What happens when Tomcat fails during the upload process. Will it simply throw a 50X error. Is it possible to gracefully handle the server failure and forward the rest of the request to a different server. ...

What do the numbers in a multi-part email mean?

I'm looking at the source of a multi-part message from Thunderbird (in hopes of writing my own multi-part message from C++/Javascript) I was wondering what the follow means (the part between the text-only part and the html part of the email) and how I might calculate it for my own program to generate a multi-part email: This is a multi...

What should a Multipart HTTP request with multiple files look like?

I'm working on an iPhone app that makes a multipart HTTP request with multiple image files. It looks like what's happening, on the server side, is that one of the images is getting parsed properly, but the other two files are not. Can anybody post a sample HTTP multipart request that contains multiple image files? ...

Python: Sending Multipart html emails which contain embedded images

I've been playing around with the email module in python but I want to be able to know how to embed images which are included in the html. So for example if the body is something like <img src="../path/image.png"></img> I would like to embed image.png into the email, and the src attribute should be replaced with a content-id. Does an...

Multipart File Upload in Ruby

I simply want to upload an image to a server with POST. As simple as this task sounds, there seems to be no simple solution in Ruby. In my application I am using WWW::Mechanize for most things so I wanted to use it for this too, and had a source like this: f = File.new(filename, File::RDWR) reply = agent.post( 'http://rest-test.her...

Send Multi-Part Email from iPhone App

I am creating an iPhone app where the user can send their work in an e-mail to whomever they wish. It is easy enough to open the Mail App using the openURL method of UIApplication. NSString* lsMailToStr = @"mailto:?subject=Subject!&body=Body"; [[UIApplication sharedApplication] openURL: [NSURL URLWithString:lsMailtoStr]]; However, it...

A custom ActionResult for a multi-part http response?

I'd like to respond to an http request with both a txt file and an html page. This way the client can save the file and see a summary of that file's contents via an html page. Since the file is generated on the fly, I have to use state management on the server to generate the summary on the second request. I'd like to avoid this and wra...

How to download multiple files with one HTTP request?

Use case: user clicks the link on a webpage - boom! load of files sitting in his folder. I tried to pack files using multipart/mixed message, but it seems to work only for Firefox This is how my response looks like: HTTP/1.0 200 OK Connection: close Date: Wed, 24 Jun 2009 23:41:40 GMT Content-Type: multipart/mixed;boundary=AMZ90RFX875L...

Multi-part gzip file random access (in Java)

This may fall in the realm of "not really feasible" or "not really worth the effort" but here goes. I'm trying to randomly access records stored inside a multi-part gzip file. Specifically, the files I'm interested in are compressed Heretrix Arc files. (In case you aren't familiar with multi-part gzip files, the gzip spec allows multipl...

Mail problem with Hungarian characters

Hi, I have a multipart mail which is processed using async read on sockets. The problem is that instead of hungarian diacritics is displayed something like =ED which is the code in hexa of character. I suppose that is some encoding pb. I've tried several encoding from iso-8859-2 to utf7. This is a part from mail header: X-MS-Has-Attac...

Python standard library to POST multipart/form-data encoded data

hello, I would like to POST multipart/form-data encoded data. I have found an external module that does it: http://atlee.ca/software/poster/index.html however I would rather avoid this dependency. Is there a way to do this using the standard libraries? thanks ...

Enumeration hasMoreElements()

I have a JSP/HTML form where there are 2 elements.One is a select dropdown and another is a File upload box(input type="file").I use POST method and enctype as form-multipart.Now I am able to access both the dropdown list and file using MultipartRequest object.No problem in that. But when I don't upload any file and when I use a code in...

How can I make a multipart/form-data POST request using Java?

In the days of version 3.x of Apache Commons HttpClient, making a multipart/form-data POST request was possible (an example from 2004). Unfortunately this is no longer possible in version 4.0 of HttpClient. For our core activity "HTTP", multipart is somewhat out of scope. We'd love to use multipart code maintained by some other...

How to write a MultiPart download C++ program

I want to write a C++ program to download files with HTTP. For the sake of learning I would like to implement multipart downloading in my program the way DownThemAll! does. It is not possible to do lseek on a linux socket. I suppose it would be some HTTP option that we would need to specify, telling where to start downloading the file fr...

Python App Engine uploaded image content-type

I know that I can accept image uploads by having a form that POSTs to App Engine like so: <form action="/upload_received" enctype="multipart/form-data" method="post"> <div><input type="file" name="img"/></div> <div><input type="submit" value="Upload Image"></div> </form> Then in the Python code I can do something like image = self.re...

Problem in displaying " inline attachment "

When I am checking the structure of an email containing inline image attachment for HTML stationery background. When I am checking the imap structure and the reference ( Gmail, Yahoo and other smart email readers are converting the cid into some URL and showing those inline attachments as the stationery of HTML background. ...