Alaska Software Inc. - Encode exe or zip file in http multipart POST request
Username: Password:
AuthorTopic: Encode exe or zip file in http multipart POST request
Vladimir IahnencoEncode exe or zip file in http multipart POST request
on Wed, 05 Jul 2006 11:14:07 -0400
Hi All,
Is there a standard WinAPI function or how to encode an executable or a zip 
file in multi-part http POST request?
Encoding type required can be read from the registry HKLM\Software\Classes\
Default is "application/octet-stream".

Thanks,
Vladimir
Phil Ide
Re: Encode exe or zip file in http multipart POST request
on Tue, 18 Jul 2006 17:15:24 +0100
Vladimir,

> Hi All,
> Is there a standard WinAPI function or how to encode an executable or a zip 
> file in multi-part http POST request?
> Encoding type required can be read from the registry HKLM\Software\Classes\
> Default is "application/octet-stream".

No WinAPI function, but any base64 mechanism works.

Regards,

Phil Ide

-----------------------------------------------------------------
xbHCL (http://www.xbHCL.com)     Xbase++ HTML command layer
PBIH  (http://www.pbih.eu)       Polar Bear International Hosting
-----------------------------------------------------------------
Xbase++ FAQ, Libraries and Sources:
http://www.idep.org.uk/xbase

Variables won't; Constants aren't.
Vladimir IahnencoRe: Encode exe or zip file in http multipart POST request
on Thu, 20 Jul 2006 10:12:09 -0400
Phil,
I created an html file with 2 inputs - text and file. Attached an executable 
and compared the message body which contained an attachment and the 
attachment (executable) content itself. Message content I took from Fiddler. 
They were identical, no any encoding.

I created a multi-part message, attached an executable (FRead(Attachment)) 
and
sent (LoadFromURL, method POST) it to a php script  and compared received 
one with original. It worked. But I tested only on my local system.

Regards,
Vladimir

"Phil Ide" <phil@pbih.net> wrote in message 
news:f62cd9v499w4.dlg@pbih.net...
> Vladimir,
>
>> Hi All,
>> Is there a standard WinAPI function or how to encode an executable or a 
>> zip
>> file in multi-part http POST request?
>> Encoding type required can be read from the registry 
>> HKLM\Software\Classes\
>> Default is "application/octet-stream".
>
> No WinAPI function, but any base64 mechanism works.
>
> Regards,
> -- 
> Phil Ide
>
> -----------------------------------------------------------------
> xbHCL (http://www.xbHCL.com)     Xbase++ HTML command layer
> PBIH  (http://www.pbih.eu)       Polar Bear International Hosting
> -----------------------------------------------------------------
> Xbase++ FAQ, Libraries and Sources:
> http://www.idep.org.uk/xbase
>
> Variables won't; Constants aren't.
Phil Ide
Re: Encode exe or zip file in http multipart POST request
on Thu, 20 Jul 2006 16:01:49 +0100
Vladimir,

> I created an html file with 2 inputs - text and file. Attached an executable 
> and compared the message body which contained an attachment and the 
> attachment (executable) content itself. Message content I took from Fiddler. 
> They were identical, no any encoding.
> 
> I created a multi-part message, attached an executable (FRead(Attachment)) 
> and
> sent (LoadFromURL, method POST) it to a php script  and compared received 
> one with original. It worked. But I tested only on my local system.

Yes, that works too. The way it is done is through the boundary markers,
which delimit the start and end of a part. I made a mistake in suggesting
base64 - this is used in 7-bit transportation systems (such as SMTP) to
cater for 'illegal' characters.

My apologies.

Regards,

Phil Ide

-----------------------------------------------------------------
xbHCL (http://www.xbHCL.com)     Xbase++ HTML command layer
PBIH  (http://www.pbih.eu)       Polar Bear International Hosting
-----------------------------------------------------------------
Xbase++ FAQ, Libraries and Sources:
http://www.idep.org.uk/xbase

Patience is a virgin.