Arc Forumnew | comments | leaders | submitlogin
How to upload files?
2 points by coconutrandom 5591 days ago | 2 comments

  (defop upload req
    (aform (fn (req) (prn req)) 
      (pr (tag (input name "uploadedfile" type "file"))) (submit)))
This does not work, noticeably the form is missing the enctype="multipart/form-data" And if enctype is added via firebug or the entire form is pr as a string, it still hangs the server, then outputs the following:

  arc> srv thread took too long for 127.0.0.1
  user break
 
  === context ===
  /home/tim/sites/arc3/ac.scm:884:12: readc
  gs1058
  handle-post
  gs1048
  gs1048
  handle-request-thread


2 points by CatDancer 5591 days ago | link

As far as I know, no one has written code for Arc yet to decode multipart/form-data.

I was too lazy to work on a multipart/form-data decoder myself... since I run a number of servers, it was easy enough for me to have the form posted to another one of my servers (Perl in my case) to handle the file upload, and then I have it redirect the user back to my Arc server to continue after the file upload.

-----

1 point by coconutrandom 5591 days ago | link

ok, that explains that. thank you

-----