[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uploading Word documents, PDFs, PNG files etc

From: Sebastian Tennant
Subject: Re: Uploading Word documents, PDFs, PNG files etc
Date: Tue, 12 May 2009 10:15:52 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Quoth Thien-Thi Nguyen <address@hidden>:
> () Sebastian Tennant <address@hidden>
> () Sun, 10 May 2009 16:21:29 +0000
>       (with-output-to-file (string-append USER-UPLOAD-DIR upload-fname)
>         (lambda ()
>           (display upload)))
> Perhaps you can convert the string in variable `upload' to a uniform vector
> and write it out using `uniform-vector-write'.  It may be the case, too,
> that the string can be passed to `uniform-vector-write' directly, e.g.:
>       (with-output-to-file (string-append USER-UPLOAD-DIR upload-fname)
>         (lambda ()
>           (uniform-vector-write upload)))


On closer inspection, it is the call to (cgi:upload ...) which throws
the error so there is no way of converting the result to a vector before
trying to write it to disk.


 (define (upload name)
   (and=> (uploads name) car))

cgi.scm is so full of closures it makes my head swim but from what I can
gather the upload is extracted and stored in memory at the
initialisation stage (cgi:init) which would suggest to me that the
problem doesn't lie within the procedure parse-form-multipart as this is
called by (cgi:init).

Given that guile 1.8.6 can actually handle null chars in strings
(despite what the error message says) what could the problem be?


P.S. Documentation bug - the procedure 'and=>' is missing from the
     manual.  What's the difference between the way the upload procedure
     is written above and simply:

      (define (upload name)
        (car (uploads name)))

Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]