[Seaside] Making a download page
avishefi at gmail.com
Sun Mar 13 08:05:40 UTC 2011
Your code is fine, and works OK. The only thing that's wrong is that it uses
contentType:attachementWithFileName , whereas X-Accel-Redirect doesn't
require these headers. Using these headers will confuse browsers into
thinking that you're actually trying to download a file (without X-Sendfile
redirection). This is why you get a file with 0 bytes - there's no file
contents in the transport.
You should use only contentType and X-Accel-Redirect to specify your file.
On Fri, Mar 11, 2011 at 12:12 PM, AA <aa at serendip.demon.co.uk> wrote:
> Thanks for looking at the headers. Here's the rest of my code:
> renderUploadOn: html
> html form multipart; with: [
> html fileUpload callback: [ :f | self uploadFile: f ].
> html submitButton text: 'Load' ]
> uploadFile: aFile
> file := (FileDirectory default directoryNamed: self filePath)
> forceNewFileNamed: aFile fileName.
> [ file binary; nextPutAll: aFile contents ]
> ensure: [ file close ].
> ^ file
> On Fri, 11 Mar 2011 11:11:45 +0200
> Avi Shefi <avishefi at gmail.com> wrote:
> > Amir,
> > The headers look fine. I'm interested in your code, specifically from
> > you get a MultiByteFileStream.
> > Could you elaborate please? maybe supply your code?
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside