guile-user
[Top][All Lists]
Advanced

[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: Wed, 13 May 2009 14:02:01 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Quoth Thien-Thi Nguyen <address@hidden>:
> 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

I've isolated the problem.

(info "(guile-1.8)Regexp Functions")

 "Zero bytes (`#\nul') cannot be used in regex patterns or input
  strings, since the underlying C functions treat that as the end of
  string.  If there's a zero byte an error is thrown."

This restriction must have been added in guile > 1.4 if binary file
uploads are possible in ttn's 1.4.x branch.  It (the restriction) breaks
the named let get-pair (part of parse-form-multipart) called via
cgi:init:

(define (parse-form-multipart)
 ...
 (let* ((segment (car segment-newstart))
        (try (lambda (rx extract)
               (and=> (regexp-exec rx segment)  ; <-- #\nuls cause this to fail
                      extract)))
        (name (or parent-name
                  (try name-exp  m1)))
        (value    (try value-exp match:suffix)) ; <-- when called from here
        (type     (try type-exp  m1)))
 ... )
 )

Seb

-- 
Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.
http://home.gna.org/eap





reply via email to

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