Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help! need to get a binary image from an http request and write to file

Explorer ,
Jul 29, 2010 Jul 29, 2010

First a little background,  I'm creating a virtual webdav server in CF that will allow me to create a repository to store comments from an acrobat Shared Review (webdav).  I have iis intercepting the webdav verbs and passing them on to my CF template which then responds appropriately using cfheader and cfcontent tags.  Everything is working great, except for the custom stamps.  The custom stamps don't display properly (i get a stamp with no image inside of it).  I'm using GetHttpRequestData() and <cffile action="write"> to write the content of the request to a file.  but when i compare the saved file's contents with the contents of the same image saved over true webdav, there are slight differences in some of the characters that should not exist.  If i have the template to respond with the file that was saved via true webdav, the image displays properly.  So it seems that CF is making some very slight alterations to the http content before or during saving.  I've played around with the encoding but that didn't seem to help.  I have used a packet monitor to verify that acrobat is sending exactly the same data to both CF and true webdav, but the file saved via CF is altered.  Does anyone have any suggestions on what I could try?

4.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 29, 2010 Jul 29, 2010

The first thing I recommend is to post some code demonstrating what you're seeing. We'll have to make some assumptions about what IIS is doing with the requests before passing to CF, but as you say it sounds like that part is working OK.

Can you also post a copy of all the HTTP headers for an example request.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 29, 2010 Jul 29, 2010

I'm using an ISAPI filter in IIS to rewrite the url to a coldfusion template.  That part is working great.

My code for the PUT verb looks like this:

<cfset HttpRequestData = GetHttpRequestData()>
<cfset RequestContent =  HttpRequestData.content>
<cffile action="write" file="MyFile.bin" output="#RequestContent#" addNewLine="no" fixnewline="no">

The Http request looks like this:


PUT /secure/data/projects/proj_109/annotations/001CFDavThurs1.pdf__aa2e6c6df6604c4d9ae927022427386d/attachments/0-55d287db-c9e5-438d-b5cb-6b94ac123c58.bin HTTP/1.1
Accept: */*
User-Agent: Mozilla/3.0 (compatible; Adobe Synchronizer 10.0)
Host: 68.2.42.213
Content-Length: 2427
Connection: Keep-Alive

%CSO-1.0%
1 0 obj<</- 2 0 R/Type/Catalog>>endobj2 0 obj<</BBox[12.0 12.0 60.0 60.0]/Filter[/FlateDecode]/FormType 1/Length 39/Matrix[1.0 0.0 0.0 1.0 -12.0 -12.0]/Name/FRM/Resources<</ProcSet[/PDF/ImageC]/XObject<</Im0 3 0 R>>>>/Subtype/Form/Type/XObject>>stream
H**B RF k
endstreamendobj3 0 obj<</BitsPerComponent 8/ColorSpace/DeviceRGB/Filter/DCTDecode/Height 48/Length 1226/Name/X/SMask 4 0 R/Subtype/Image/Type/XObject/Width 48>>stream
Adobed$''''$25552;;;;;;;;;;


####''',,,00"B

3!1AQa"q2B#$Rb34rC%Scs5&DTdEt6UeuF'Vfv7GWgw;!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw?I%)i^7pT$ho<Ep)p\r{tW-1q`#}<Kp;,R<-t}pqt.xNm0O}W{se%;`@+1(r3:Yts"R$
5nkXp/k5x*))7Zgz;i\!lpllpx0u])f~Q6t{Y'ljK,o8h1>K#fh.!t69fUECd}:)kZ4!v[.]Xs6 k|H>VkfWRuu48*+~b!33
57VYmNs8q3Hgh<FUwOz{|,tG~B>}m~qqc1C0Fi:gY~vs51y`3F<~^%I$
endstreamendobj4 0 obj<</BitsPerComponent 8/ColorSpace/DeviceGray/Filter/FlateDecode/Height 48/Length 366/Name/X/Subtype/Image/Type/XObject/Width 48>>stream
HK1Q:Aussp]8RqTA:V `sa8n$.g?z[LxW\{A|%7)`'@)
*@aep|2?CQWuws{6n<5V{=q{S
Rzkd/=j./i])H`WIED?-cQmw"6I6//[,2k$:uvM>M{VG-3<z]4_Zlz0WPMyayhIaKq`Z`b
endstreamendobjxref
0 5
0000000000 65535 f
0000000016 00000 n
0000000057 00000 n
0000000331 00000 n
0000001730 00000 n
trailer
<</Size 5/Root 1 0 R>>
startxref
2259
%%EOF

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 29, 2010 Jul 29, 2010

After some research and creating some output tests, I believe that my problem is that acrobat does not specify a content-type in the PUT request header.  Therefore CF seems to be casting it from binary to text:

From the CF documentation

ColdFusion recognizes the response body as text if:

  • the header does not specify a content type.
  • the content type starts with "text".
  • the content type starts with "message".
  • the content type is "application/octet-stream".

Does anyone know how to prevent coldfusion from converting the content or how to get it back into its original state?  ToBinary(ToBase64(MyVariable)) gets close but ends up corrupting the original data (which prevents the image from displaying).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 30, 2010 Jul 30, 2010

I could be wrong .. but I am not sure you can reverse it. At least not reliably. From what I recall, byte sequences that are not representable in a given character set, may be dropped or converted into something else like "?" (ie uknown character). In which case, I am not sure it is possible to reverse the changes and get back the original values. 

Any way you can intercept the request and add a content-type header instead?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 30, 2010 Jul 30, 2010

Yep!  I think you've nailed it, it's replacing characters with question marks.  I'm working to intercept and rewrite the header now.  I'll post back with my results.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 02, 2010 Aug 02, 2010

Well I was able to intercept the request and add in a content-type header, but I still seem to be having some problems.  When i dump the httpRequestData (output.filecontent), i get a java.io.ByteArrayOutputStream.  I tried using the following script (from a forum post by an amazing coder by the name of cfSearching)

<cfscript>
saveToFile = expandPath("./test.bin");
outStream = createObject("java", "java.io.FileOutputStream").init( saveToFile );
outStream.write( output.filecontent.toByteArray() );
outStream.flush();
// always close the stream
outStream.close();
</cfscript>

It seems as if some of the characters are still altered because the image does not display properly.

I'm not very familiar with java, but im wondering if there is a better way to write this to file.

could it be that toByteArray() is somehow altering the original content?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 02, 2010 Aug 02, 2010

Could you post a dump of the new headers and attach the before and after (invalid) image files?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 02, 2010 Aug 02, 2010

Here is a dump of the PUT request that is being sent by acrobat to CF.  I've intercepted the request and rewritten the header in IIS to include a content-type.

Request: {ts '2010-08-02 13:10:48'}

struct
content%CSO-1.0%âãÏÓ 1 0 obj<</- 2 0 R/Type/Catalog>>endobj2 0 obj<</BBox[12.0 12.0 60.0 60.0]/Filter[/FlateDecode]/FormType 1/Length 39/Matrix[1.0 0.0 0.0 1.0 -12.0 -12.0]/Name/FRM/Resources<</ProcSet[/PDF/ImageC]/XObject<</Im0 3 0 R>>>>/Subtype/Form/Type/XObject>>stream H‰*ä* B      R†F ”œË¥ï™k à’Ï  †  ¢£  endstreamendobj3 0 obj<</BitsPerComponent 8/ColorSpace/DeviceRGB/Filter/DCTDecode/Height 48/Length 1226/Name/X/SMask 4 0 R/Subtype/Image/Type/XObject/Width 48>>stream ÿØÿî Adobed€ ÿÛ„                                       $''''$25552;;;;;;;;;;                                                 ####''',,,ÿÀ  00  "      ÿÄ B                                                  3     ! 1 AQa "q?2  ‘¡±B#$ RÁb34r‚ÑC %’Sðáñcs5 ¢²ƒ&D“TdE£t6 ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷               ;    !1  AQaq"  2?‘ ¡±B#ÁRÑð3$bár‚’CS cs4ñ%  ¢²ƒ &5ÂÒD“T£ dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·Ç×ç÷ÿÚ       ?ò¤’I%)iý^ú¿›õ‹7츾ʙ ÈÈpöTÃÜñ$þhï÷•oêŸÕ<¯¬¹EΚp)p ß “ϧ\òóør{ é  tÿ©W-· ‡ 1q`#}¶<¶°û âK„˜Ðp;,ψüR<¼‡-ƒ×Ì̈Ät‰–‚ÿ­Ø}¬Øpqúç¤ ¾tùÇÖÜ.—ÑíÆèx Ô» …ù™N ëm¸0†í? Ö´ €OÒñ•€§‘}¹WÙ“{·ÛsÝeŽ€%Ï;œ`@ä¨+ø1Ë (Âr3? © ²:ÈùYÐt s"R$   ‚”ª5‹ nkŸXp/k  âÙÔ5ůÇx*))7ZûgÕ®³Ðz¦;ièîª¦Ö ¾ÆÖŠ?\Ã?ú! ß«†“Ýlõ ™ƒÕplÀê úØöíÞÍÎlípx÷0´òм £àçu §?‡Ó]³)»fÂÏ~ýÃQ´6t×Á{•Y'  ¿lÈ  j ¾K€­®,o¾Â8h1>K?ø¿ÃÇ#› °f‘”? ޾ähé.!Üìt6ÝÅ9f‰¸Ð Uó?¬ßâÖΗEÝC¤d}£ †:Û)¾ kZÀÒâ×4 ¿ó?ÓÄ®!vß[¿Æ º“ Óº.êñž ]÷XѺֻs6±®?­ Ìèï„kÄ®‹á|ö çHãý  > ëV—ø÷kföÄ¿WõíôR•uÙu?ª¦—Øò Æ4 ç8˜ É*+¥ú½“Ò~®b×õ‹!ã3¨Øç3  §í57VYm?NÑ çú¶så8¡q?É3é„ éHíghŽäì Â<F‰¡Ôö UѺwOú?ÐÝÔz° ε±{? |“,Æ«?t÷G~ûBã>±}mê ~Í’qqc1䵯C‹¬0ÝæFši÷“?Õ:¦gYÌ~vs÷Øý 5? 1ƒ° 모ªò¿  æyž`Œ¼ÄÏ  èÃÂöØ Ì™3ÜF<~˜ ¶^%I$’¾ÂÿÿÙ endstreamendobj4 0 obj<</BitsPerComponent 8/ColorSpace/DeviceGray/Filter/FlateDecode/Height 48/Length 366/Name/X/Subtype/Image/Type/XObject/Width 48>>stream H‰¬Ô¿K 1  刻Q„:  A     ussÓ½‚ˆ ô p ÜÄÍÅ¡] Ä© Š8éâRqTA:V©àà ˆ‚ƒ`sϤ¹ëa‡Ë ø8nú$÷.—œÈ¿gÆ? ?zñ[LxèŽW\{ðA Œð| À%Ï7€ š ´Æ)ͯ`ÒÇò'@) ’ºÿ  *@ ǧa³Ïñ  e p| ?2 » ?C”Q†WИÜÌŸuëžwĹs{û¦á…꤃Ï6Ë„•n†’ <£5罉 –¿þVÒ{î =qĪ  {S ¹äRùzk©d/² =ÂÞj./i]¼Ù§Òæôò —)ºµH`WIóE†ŸDÕ?  ž?º” -cQ™mŠË ìw"6´I¸6/Ý /ØÃ[â´,Ø2k$Ϙý‰:uvM>Mõ{Vëߦî²Gó-3û<ͳz]ÞÒ4ïÔ“_ÐZ¤ lzð 0åÁWPMyða yhIaɇKqÜ‹“ù `Z`bº endstreamendobjxref 0 5 0000000000 65535 f 0000000016 00000 n 0000000057 00000 n 0000000331 00000 n 0000001730 00000 n trailer <</Size 5/Root 1 0 R>> startxref 2259 %%EOF
headers
struct
Accept*/*
ConnectionKeep-Alive
Content-Length2427
Content_Typeimage/jpeg
CookieCFID=218173; CFTOKEN=84164853
Hostmysite.com
User-AgentMozilla/3.0 (compatible; Adobe Synchronizer 10.0)
methodPUT
protocolHTTP/1.1

Here is what the image.bin file looks like when saved by traditional webdav (works great).

%CSO-1.0

%âãÏÓ

1 0 obj

<</- 2 0 R/Type/Catalog>>

endobj

2 0 obj

<</BBox[12.0 12.0 60.0 60.0]/Filter[/FlateDecode]/FormType 1/Length 39/Matrix[1.0 0.0 0.0 1.0 -12.0 -12.0]/Name/FRM/Resources<</ProcSet[/PDF/ImageC]/XObject<</Im0 3 0 R>>>>/Subtype/Form/Type/XObject>>stream

H‰*ä* B
   R†F "œË¥ï™k à’Ï  †&#0;  &#0;¢£  endstream

endobj

3 0 obj

<</BitsPerComponent 8/ColorSpace/DeviceRGB/Filter/DCTDecode/Height 48/Length 1226/Name/X/SMask 4 0 R/Subtype/Image/Type/XObject/Width 48>>stream

ÿØÿî&#0; Adobe&#0;d€&#0;&#0;&#0; ÿÛ&#0;„&#0;

  




                   ---  $''''$25552;;;;;;;;;;

 

 

 

                                        -----####''',,,ÿÀ&#0;  &#0;0&#0;0  "&#0;     ÿÄ B&#0;&#0;       &#0;&#0;&#0;&#0;&#0;&#0;&#0; &#0;  


&#0;       &#0;&#0;&#0;&#0;&#0;&#0;&#0; &#0;  


&#0;      

3 &#0;   ! 1AQa "q2  ‘¡±B#$ RÁb34r‚ÑC %’Sðáñcs5 ¢²ƒ&D"TdE£t6 ÒUâeò³„ÃÓuãóF'"¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷ &#0;        ; &#0;  !1  AQaq" 2‘ ¡±B#ÁRÑð3$bár‚’CS cs4ñ%  ¢²ƒ &5ÂÒD"T£ dEU6teâò³„ÃÓuãóF"¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·Ç×ç÷ÿÚ&#0;

  &#0;   &#0;?&#0;ò¤’I%)iý^ú¿›õ‹7츾ʙ ÈÈpöTÃÜñ$þhï÷•oêŸÕ<¯¬¹EΚp)p ß "ϧ\òóør{ é  tÿ&#0;©W-· ‡ 1&#0;q`#}¶<¶°ûâK„˜Ðp;,ψüR<¼‡-ƒ×Ì̈Ät‰–‚ÿ&#0;Ø}¬Øpqúç¤ ¾tùÇÖÜ.—ÑíÆèx Ô» …ù™N ëm¸0†í Ö´ €OÒñ•€§‘}¹WÙ"{·ÛsÝeŽ€%Ï;œ`@ä¨+ø1Ë (Âr3-©-²:ÈùYÐt

s"R$

  ‚"ª5‹ nkŸXp/k  âÙÔ5ů&#0;Çx*))7ZûgÕ®³Ðz¦;ièÖ
¾ÆÖŠ\Ýú! ß«†"Ýlõ ™ƒÕplÀê úØöíÞÍÎlípx÷0´òм £àçu-§‡Ó]³)»fÂÏ~ýÃQ´6t×Á{•Y'  ¿lÈ  j-¾K€®,o¾Â8h1>Kø¿ÃÇ#› °f‘" ޾ähé.!Üìt6ÝÅ9f‰¸Ð Uó¬ßâÖΗEÝC¤d}£ †:Û)¾ kZÀÒâ×4 ¿ó

ÓÄ®!vß[¿Æ
º" Óº.êñž]÷XѺֻs6±® Ìèï„kÄ®‹á|ö çHãý  >ëV—ø÷kföÄ¿WõíôR•uÙuª¦—Øò Æ4 ç8˜&#0; É*+¥ú½"Ò~®b×õ‹!ã3¨Øç3

§í57VYmNÑ çú¶så8¡qÉ3é„ éHíghŽäì Â<F‰¡Ôö UѺwOúÐÝÔz°

ε±{ |",Æ«t÷G~ûBã>±}mê ~Í’qq&#0;&#0;c1䵯C‹¬0ÝæFši÷"Õ:¦gYÌ~vs÷Øý&#0; 5 1ƒ°ëª¨ªò¿  æyž`Œ¼ÄÏ  èÃÂ&#0;öØ-Ì™3ÜF<~˜ ¶^%I$’¾Âÿ&#0;ÿÙ

endstream

endobj

4 0 obj

<</BitsPerComponent 8/ColorSpace/DeviceGray/Filter/FlateDecode/Height 48/Length 366/Name/X/Subtype/Image/Type/XObject/Width 48>>stream

H‰¬Ô¿K 1 刻Q„:  A    

ussÓ½‚ˆ ôp ÜÄÍÅ¡] Ä© Š8éâRqTA:V©àà ˆ‚ƒ`sϤ¹ëa‡Ë
ø8nú$÷.—œÈ¿gƏ?zñ[LxèŽW\{ðAŒð| À%Ï7€&#0; š ´Æ)ͯ`ÒÇò'@) ’ºÿ

*@ ǧa³Ïñ  ep| 2-» ?C"Q†WИÜÌŸuëžwĹs{û¦á…꤃Ï6Ë„•n†’ <£5罉 –¿þVÒ{î =qĪ- {S

¹äRùzk©d/²-=ÂÞj./i]¼Ù§Òæôò —)ºµH`WIóE†ŸDÕ?  žº" -cQ™mŠË ìw"6´I¸6/Ý /ØÃ[â´,Ø2k$Ϙý‰:uvM>Mõ{Vëߦî²Gó-3û<ͳz]ÞÒ4ïÔ"_ÐZ¤ lzð 0åÁWPMyða yhIaɇKqÜ‹"ù `&#0;Z`bº

endstream

endobj

xref

0 5

0000000000 65535 f

0000000016 00000 n

0000000057 00000 n

0000000331 00000 n

0000001730 00000 n

trailer

<</Size 5/Root 1 0 R>>

startxref

2259

%%EOF

And here is what the exact same image.bin file looks like when saved by CF (altered and does not display).

%CSO-1.0

%âãÏÓ

1 0 obj

<</- 2 0 R/Type/Catalog>>

endobj

2 0 obj

<</BBox[12.0 12.0 60.0 60.0]/Filter[/FlateDecode]/FormType 1/Length 39/Matrix[1.0 0.0 0.0 1.0 -12.0 -12.0]/Name/FRM/Resources<</ProcSet[/PDF/ImageC]/XObject<</Im0 3 0 R>>>>/Subtype/Form/Type/XObject>>stream

H‰*ä* B
   R†F "œË¥ï™k à’Ï  †&#0;  &#0;¢£  endstream

endobj

3 0 obj

<</BitsPerComponent 8/ColorSpace/DeviceRGB/Filter/DCTDecode/Height 48/Length 1226/Name/X/SMask 4 0 R/Subtype/Image/Type/XObject/Width 48>>stream

ÿØÿî&#0; Adobe&#0;d€&#0;&#0;&#0; ÿÛ&#0;„&#0;

  




                   ---  $''''$25552;;;;;;;;;;

 

 

 

                                        -----####''',,,ÿÀ&#0;  &#0;0&#0;0  "&#0;     ÿÄ B&#0;&#0;       &#0;&#0;&#0;&#0;&#0;&#0;&#0; &#0;  


&#0;       &#0;&#0;&#0;&#0;&#0;&#0;&#0; &#0;  


&#0;      

3 &#0;   ! 1AQa "q2  ‘¡±B#$ RÁb34r‚ÑC %’Sðáñcs5 ¢²ƒ&D"TdE£t6 ÒUâeò³„ÃÓuãóF'"¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷ &#0;        ; &#0;  !1  AQaq" 2‘ ¡±B#ÁRÑð3$bár‚’CS cs4ñ%  ¢²ƒ &5ÂÒD"T£ dEU6teâò³„ÃÓuãóF"¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·Ç×ç÷ÿÚ&#0;

  &#0;   &#0;?&#0;ò¤’I%)iý^ú¿›õ‹7츾ʙ ÈÈpöTÃÜñ$þhï÷•oêŸÕ<¯¬¹EΚp)p ß "ϧ\òóør{ é  tÿ&#0;©W-· ‡ 1&#0;q`#}¶<¶°ûâK„˜Ðp;,ψüR<¼‡-ƒ×Ì̈Ät‰–‚ÿ&#0;Ø}¬Øpqúç¤ ¾tùÇÖÜ.—ÑíÆèx Ô» …ù™N ëm¸0†í Ö´ €OÒñ•€§‘}¹WÙ"{·ÛsÝeŽ€%Ï;œ`@ä¨+ø1Ë (Âr3-©-²:ÈùYÐt

s"R$

  ‚"ª5‹ nkŸXp/k  âÙÔ5ů&#0;Çx*))7ZûgÕ®³Ðz¦;ièÖ
¾ÆÖŠ\Ýú! ß«†"Ýlõ ™ƒÕplÀê úØöíÞÍÎlípx÷0´òм £àçu-§‡Ó]³)»fÂÏ~ýÃQ´6t×Á{•Y'  ¿lÈ  j-¾K€®,o¾Â8h1>Kø¿ÃÇ#› °f‘" ޾ähé.!Üìt6ÝÅ9f‰¸Ð Uó¬ßâÖΗEÝC¤d}£ †:Û)¾ kZÀÒâ×4 ¿ó

ÓÄ®!vß[¿Æ
º" Óº.êñž]÷XѺֻs6±® Ìèï„kÄ®‹á|ö çHãý  >ëV—ø÷kföÄ¿WõíôR•uÙuª¦—Øò Æ4 ç8˜&#0; É*+¥ú½"Ò~®b×õ‹!ã3¨Øç3

§í57VYmNÑ çú¶så8¡qÉ3é„ éHíghŽäì Â<F‰¡Ôö UѺwOúÐÝÔz°

ε±{ |",Æ«t÷G~ûBã>±}mê ~Í’qq&#0;&#0;c1䵯C‹¬0ÝæFši÷"Õ:¦gYÌ~vs÷Øý&#0; 5 1ƒ°ëª¨ªò¿  æyž`Œ¼ÄÏ  èÃÂ&#0;öØ-Ì™3ÜF<~˜ ¶^%I$’¾Âÿ&#0;ÿÙ

endstream

endobj

4 0 obj

<</BitsPerComponent 8/ColorSpace/DeviceGray/Filter/FlateDecode/Height 48/Length 366/Name/X/Subtype/Image/Type/XObject/Width 48>>stream

H‰¬Ô¿K 1 刻Q„:  A    

ussÓ½‚ˆ ôp ÜÄÍÅ¡] Ä© Š8éâRqTA:V©àà ˆ‚ƒ`sϤ¹ëa‡Ë
ø8nú$÷.—œÈ¿gƏ?zñ[LxèŽW\{ðAŒð| À%Ï7€&#0; š ´Æ)ͯ`ÒÇò'@) ’ºÿ

*@ ǧa³Ïñ  ep| 2-» ?C"Q†WИÜÌŸuëžwĹs{û¦á…꤃Ï6Ë„•n†’ <£5罉 –¿þVÒ{î =qĪ- {S

¹äRùzk©d/²-=ÂÞj./i]¼Ù§Òæôò —)ºµH`WIóE†ŸDÕ?  žº" -cQ™mŠË ìw"6´I¸6/Ý /ØÃ[â´,Ø2k$Ϙý‰:uvM>Mõ{Vëߦî²Gó-3û<ͳz]ÞÒ4ïÔ"_ÐZ¤ lzð 0åÁWPMyða yhIaɇKqÜ‹"ù `&#0;Z`bº

endstream

endobj

xref

0 5

0000000000 65535 f

0000000016 00000 n

0000000057 00000 n

0000000331 00000 n

0000001730 00000 n

trailer

<</Size 5/Root 1 0 R>>

startxref

2259

%%EOF

It looks to me like CF is translating the request regardles of the header...

I feel like im missing something really minor here...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 02, 2010 Aug 02, 2010

You cannot really view binary content in html properly. Could you attach the saved image files (both the good and malformed one)? I believe this forum allows uploads.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 02, 2010 Aug 02, 2010

Hmm I tried attaching but didn't see where I could do that. Lets see if I can reply via email and attach the files that way...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 02, 2010 Aug 02, 2010

doh! I guess that doesn't work.  I went ahead and just emailed them to you as attachments, I hope you don't mind.  Thanks again for the help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2010 Aug 10, 2010

any luck with this?  I had started on the same type of project (office files instead)  and got to the point of url rewriting before giving up

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 19, 2010 Aug 19, 2010

I'm still working on the binary data portion, but i do have the rest of the coldfusion virtual webdav portion done.  I have a meeting with Adobe CF support in an hour, I'll post up and let you know.  Just for clarification, are you also having trouble with CF attempting to decode the request into text before you can save the file?  Or did you not get that far?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 19, 2010 Aug 19, 2010

I am trying to write the binary to a file, but CF garbles it first. Oi saw the same thing you did with the doctype header, I didn't try URL rewriting though

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 19, 2010 Aug 19, 2010

I'm using IIS6 and the IIRF ISAPI filter to rewrite the url, what are you using?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 19, 2010 Aug 19, 2010

When I have time to try it will be with IIS 7. And the new IIS rewrite tool

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 20, 2010 Aug 20, 2010

I was finally able to get CF to stop translating the request content to text.  Turns out there is a typo in the ColdFusion documentation:

ColdFusion documentation:

Raw content from form submitted by client, in string or binary format. For content to be considered string data, the FORM request header "CONTENT_TYPE" must start with "text/" or be special case "application/x-www-form-urlencoded". Other types are stored as a binary object.

CONTENT_TYPE should actually read CONTENT-TYPE

I was able to use the rewrite module to change the CONTENT-TYPE header from "text/" to "bin/data". which solved the problem completely.  Now the content request comes through as a binary object instead of being converted to text.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 20, 2010 Aug 20, 2010

{smacks forehead} I am embarrassed to say my brain was "seeing" content-type, not content_type.

Glad the mystery is solved Also, if this is in the online documentation, you might add a comment mentioning the typo. It might save someone else a few headaches ..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 08, 2010 Oct 08, 2010
LATEST

I am trying to do this VERY thing!  I am using IIS7 and have installed the IIS Rewrite 2.0 Plugin but I don't have a clue how to configure it to rewrite my PUT requests to add a content-type header if one is missing.  Can anyone help me out?

--Stewart McGuire

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources