Correct Content-Type For MMS POST

Correct Content-Type For MMS POST SearchSearch
Author Message
Ben Wilson
New member
Username: Bmwilson

Post Number: 1
Registered: 11-2003
Posted on Sunday, November 30, 2003 - 11:54 pm:   

Hi Bryce,

I'm working with posting to NowSMS. I have everything working except posting precompiled MMS files (*.mms).

I'm wondering if I'm using the correct Content-type? I've tried application/vnd.wap.mms.message, application/vnd.wap.multipart.related & application/vnd.wap.mms-message all to no avail.

I'm pretty sure the basic mechanism I'm using is working (i.e. base64 encoding) as I am able to send a jpeg with content-type image/jpeg without problems.

I'm using .NET's HttpWebRequest class, which gives a vague 'ProtocolError' message when trying to send a MMS file. Like I said jpegs are fine.

Here's a snippet of the form I'm sending:

----boundary-border--
Content-Disposition: form-data; name="PhoneNumber"

+12507777076
----boundary-border--
Content-Disposition: form-data; name="MMSFrom"

+12506661386
----boundary-border--
Content-Disposition: form-data; name="MMSSubject"

Interesting Subject
----boundary-border--
Content-Disposition: form-data; name="MMSText"

Hello World Text!
----boundary-border--
Content-Disposition: form-data; name="MMSFile"; filename="adprint01b.mms"
Content-Type: application/vnd.wap.mms.message

..omitted for brevity...
----boundary-border----


Any help greatly appreciated!

Best regards,

Ben.
Ben Wilson
New member
Username: Bmwilson

Post Number: 2
Registered: 11-2003
Posted on Monday, December 01, 2003 - 06:46 pm:   

Hi again,

Follow-up to my previous post. The NowSMS web server is giving 400 Bad Request as the error message and the text:

Error:.Invalid.MMS.Content
MMS.Message.Type.miss
ing.or.invalid.(should.be.m-retrieve-conf)

...which I take to mean there is something wrong with the MMS file itself or perhaps the base64 encoding I'm using is not correct.

I notice when an MMS file comes from the Browser to NowSMS:8800 the content type is application/octet-stream rather than application/vnd.wap.mms-message. For the octet-stream I suppose no encoding is required - just the raw binary of the MMS file?

Hope this is less vague than my last posting.

Ben Wilson
Cube80 Ltd.
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1295
Registered: 10-2002
Posted on Tuesday, December 02, 2003 - 08:52 am:   

Ben,

That is puzzling because I don't think we actually look at the "Content-type:" header for the MMSFile parameter. Instead, we are basing the content type for this type of submission on the file extension. Either way, both ".mms" and "application/vnd.wap.mms-message" appear correct.

I can't imagine why you'd see a "protocol error" sending an MMS file but not when sending a JPG.

How about enabling the debug log, and let's see if that tells us anything. Manually edit SMSGW.INI, and under the [SMSGW] section header, add Debug=Yes. Then let's see if there is something in the SMSDEBUG.LOG that gives us a clue.

-bn
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1296
Registered: 10-2002
Posted on Tuesday, December 02, 2003 - 09:00 am:   

Hi Ben,

Ok ... I'm working in a bit of a timewarp, downloading messages off-line this week, and responding later. So I didn't see your follow-up message.

Does it work ok if you submit the same message file via the browser?

If so, then I'm not sure that we support base64 encoding via this interface, we just expect it to be binary format.

-bn