I think you've a copy of WikiServer, use the latest one and give it a
try.
The other issue was the desire for Magritte to hand back the contents
of the file to seaside for downloading.
This might be fine on a server, but if you attempt to toss a 64MB file
on the iPhone you die, well it could
apply to a desktop machine if you move 500MB files.
The problem is
MAExternalFileModel>>urlFor: aRenderingContext
^ self baseUrl isNil
ifTrue: [ super urlFor: aRenderingContext ]
ifFalse: [ self baseUrl , '/' , (self location reduce: [ :a :b | a ,
'/' , b ]) , '/' , self filename ]
MAFileModel>>urlFor: aContext
^ aContext
urlForDocument: self contents
mimeType: self mimetype
fileName: self filename
See the "self contents" In WikiServer I changed that to
MAExternalFileModel >>urlFor: aContext
^ self baseUrl isNil
ifTrue: [aContext
urlForDocument: self
mimeType: self mimetype
fileName: self filename]
ifFalse: [ self baseUrl , '/' , (self location reduce: [ :a :b | a ,
'/' , b ]) , '/' , self filename ]
Other helper methods I had to add were
MAExternalFileModel>>asMIMEDocumentType: aMimeType
"for text documents we need to return the proper mime type aware
document otherwise we get UTF-8 errors
but for other document types we want a binary type"
self maintype = 'text'
ifTrue: [^self readStream asMIMEDocumentType: aMimeType].
^self readStreamBinary asMIMEDocumentType: aMimeType
MAExternalFileModel>>readStreamBinary
"We make a StandardFileStream instance and set to binary, oddly
someone closes this later and re-opens as
text if we make a MultiByteFileStream then it starts streaming as
utf-8 which is a bad thing"
^ (self directory readOnlyStandardFileNamed: self filename) binary
FileDirectory>>readOnlyStandardFileNamed: localFileName
"Open the existing file with the given name in this directory for
read-only access."
^ StandardFileStream readOnlyFileNamed: (self fullNameFor:
localFileName)
On 19-Apr-09, at 11:03 AM, Lukas Renggli wrote:
> Ahh,
interesting. I wasn't aware of that, only that removing the
Content-Disposition
altogether has the same effect but also loses
control over the filename. That should solve at least the problems
when the file is served through Squeak/Seaside.
Thanks for the hint.
Lukas
--
=
=
=
========================================================================
John M. McIntosh <johnmci(a)smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.
http://www.smalltalkconsulting.com
=
=
=
========================================================================