Arc Forumnew | comments | leaders | submitlogin
Re: How to upload files?
3 points by evanrmurphy 5370 days ago | 7 comments
There was a thread last year about file uploads in Arc: http://arclanguage.org/item?id=10092

I was digging through html.arc last night, and it looks like the enctype attribute and multipart/form-data decoding are still unsupported in Arc 3.1. Unless I'm mistaken about this (which would actually be great), I was wondering: what's your workaround for handling file uploads in Arc?

The first thing I was going to try (after seeking advice on Arc Forum) is looking for the tools in PLT Scheme. I also wanted to check Anarki, which I understand sometimes has bug fixes and new features before Arc main. If it comes to this, I can do what CatDancer described in the linked thread and post my form to another server. I might also like to write the decoder for Arc, but I'm unsure how large a task this would be or quite where to start (or if it's already been done and I just missed it).

In any case, I look forward to your comments on the subject!



2 points by jazzdev 5364 days ago | link

I added a first version of this to Anarki today.

See http://github.com/nex3/arc/blob/master/lib/webupload.arc

-----

1 point by coconutrandom 5355 days ago | link

Howdy, no seemed to need it at the time so here is a not too shameless plug.

http://arclanguage.com/item?id=10462

It overwrites the built in functions to parse out the form parts, but it only works on *nix systems. This was a while ago and solved my problem. ymmv ;)

http://github.com/coconutrandom/arc/blob/master/parseform.ar...

http://github.com/coconutrandom/arc/blob/master/upload-3.arc

-----

1 point by thaddeus 5370 days ago | link

I was planning on giving uploadify a whirl, but have yet to find time.

http://www.uploadify.com/what-is-it/

-----

1 point by evanrmurphy 5370 days ago | link

That looks interesting, thanks.

  > It requires Flash and any backend development language.
I'd certainly prefer an implementation that didn't depend on Flash, but this may be a "beggars can't be choosers" type of situation. :)

-----

2 points by thaddeus 5370 days ago | link

I believe this one does not use flash...

http://valums.com/ajax-upload/

-----

2 points by shader 5370 days ago | link

I'm not sure that either of those are what he's looking for. Both seem to be different ways of displaying the upload form to the user, but neither seems to change the way that the back end handles the file.

It sounds like he wants a way for arc to receive an uploaded file in an http request, and do something with the data, rather than a way to display an upload form.

-----

1 point by evanrmurphy 5370 days ago | link

Yes, that is correct.

-----