<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Jan 1, 2014, at 11:32 AM, Johan Brichau &lt;<a href="mailto:johan@inceptive.be">johan@inceptive.be</a>&gt; wrote:<br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div></div></div></span></div></span></span></div><div><blockquote type="cite"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Any specific reason you do not want to switch to the Zinc adapter?</span></blockquote></div><br><div>Yes.&nbsp;</div><div><br></div><div>Only one if I recall correctly.</div><div><br></div><div><a href="http://airflowing.com">airflowing</a>&nbsp;has an uploader with progress indicator that is tightly coupled with Comanche.</div><div><br></div><div>As far as I remember.. I've tried Zinc and it's all good except for that and unfortunately that's a deal-breaker for me.</div><div><br></div><div><div style="orphans: 2; widows: 2;"><div><a href="https://about.me/sebastianconcept">sebastian</a></div><div><br></div><div>o/</div><div><br></div><div>PD:&nbsp;<span style="orphans: auto; widows: auto;">The critical part is in having in the http server the same object receiving the chunks of bytes in a way that can trigger over and over some kind of onUploadProgress: event with the current size in the temp file and knowing the original request.&nbsp;</span><span style="orphans: auto; widows: auto;">If you tell me I can do the same with Zinc, I might take a look somewhen :D</span></div><div><span style="orphans: auto; widows: auto;"><br></span></div><div style="orphans: auto; widows: auto;">I've patched comanche to these as foundation of that idea:</div><div style="orphans: auto; widows: auto;"><br></div><div style="orphans: auto; widows: auto;"><div>WAComancheRequestConverter&gt;&gt;processMultipartFields: aKomRequest</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| fields |</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fields := WARequestFields new.<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>aKomRequest multipartFormFieldsDo: [ :chunk |</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>| key value |</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>key := chunk fieldName.</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>value := chunk fileName isEmptyOrNil</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>ifTrue: [</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>String streamContents: [ :stream |</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>chunk saveToStream: stream ] ]</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>ifFalse: [self convertMultipartFileField: chunk for: aKomRequest].</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fields at: key put: value ].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"ugly"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>aKomRequest propertyAt: #postFields put: fields</div><div><br></div></div><div style="orphans: auto; widows: auto;"><div>WAComancheRequestConverter&gt;&gt;convertMultipartFileField: aChunk for: aKomRequest</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"Creates a temporary file, announces it&nbsp;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>and begins the upload."</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| temporaryFile |<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>temporaryFile := self fileClass fromChunk: aChunk for: aKomRequest.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>temporaryFile fileName: (self codec url decode: aChunk fileName).</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>self triggerEvent: #aboutToUpload: with: temporaryFile.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>temporaryFile startUploadOn: aChunk.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^ temporaryFile&nbsp;</div><div><br></div><div><br></div><div><br></div></div><div><span style="orphans: auto; widows: auto;"><br></span></div></div></div></body></html>