[gmime-devel] GMime - parse MIME created by web browser during file upload?



I would like to know if GMime can be used to parse the MIME created by a web browser when a user uploads a binary file such as a jpg.  Here is an example of this MIME format:

------WebKitFormBoundaryFuv4ThyECHCwguJb

Content-Disposition: form-data; name="fileToUpload"; filename="gordo 2.jpg"

Content-Type: image/jpeg



***JPEG*BINARY*DATA*GOES*HERE***MADE*UP*OF*MOSTLY*NON-PRINTABLE*CHARACTERS

------WebKitFormBoundaryFuv4ThyECHCwguJb

Content-Disposition: form-data; name="submit"



Upload Image

------WebKitFormBoundaryFuv4ThyECHCwguJb--

The binary will obviously contain non-printable characters since it is an exact copy of the binary that makes up the original JPG file upload.

This is the data from the MIME above that I am interested in:

  • Content-Type
  • filename
  • binary

Please note that different web browsers create different 'boundaries'. The boundary has random numbers appended to the end of it created with each file upload.

Can GMime be used to parse out the fields above?  Thank you!




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]