> it, but they are wrapped into headers:

It is the so called MIME format which is used by browsers to send files.

> The question is, how to get rid of this header and footer safely. Is
> it enough just to delete first 4 lines and last 5 lines or it should
> be done some other way?

You should decode it carefully. The number of header lines may vary. The
last one is an empty one. Use the delimiter to find the end of data.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


----- Original Message ----- 
From: "tol" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Friday, December 29, 2006 9:25 AM
Subject: [twsocket] Safely save a binary file


> Hello twsocket,
>
> I'm trying to make the http server save binary files. I was able do do
> it, but they are wrapped into headers:
>
> -----------------------------54472172614771
> Content-Disposition: form-data; name="file"; filename="IBM_286.rar"
> Content-Type: application/octet-stream
>
> Rar!W+%~бяо+¤^?юLъ2¦ю--P-?+жOHOL--жP¦дC\iji¦л#Njr`mQcjo#A80
!O¤-¬є¦СББ-TБСTЙ-
> ....................
> ipa¬ ^-ЁгїД1Й¬*жлЧЁOLЕ6aй*\¬M?¦+tHЧTbлЎч>,T¬ЬLю-НL¬й№¦+ч
°Э·¤)¦zO2YWR¦@
> -----------------------------54472172614771
> Content-Disposition: form-data; name="Submit"
>
> Submit
> -----------------------------54472172614771--
>
>
> The question is, how to get rid of this header and footer safely. Is
> it enough just to delete first 4 lines and last 5 lines or it should
> be done some other way? Maybe there is a function to convert this raw
> output to a normal file? Please advise. Thanks.
>
>
> -- 
> Best regards,
>  tol
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
>

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to