Arc Forumnew | comments | leaders | submitlogin
4 points by aw 753 days ago | link | parent

Arc handles HTTP requests character by character, which is fine for form submits or REST APIs, but not what you want for handling large binaries.

To be able to handle image uploads directly in Arc, you'd want an HTTP server implementation which supported binary buffers.

But, not everything needs to be implemented directly in Arc. Instead you could use e.g. Ngnix or Apache to handle the image uploads, or upload the images directly to AWS S3 from the browser.



2 points by hjek 752 days ago | link

Interesting! Arc is reading the request one character at the time. I think I see where it's happening, in the handle-request-thread function where readc is called. So, for Nginx/Apache, are you suggesting Arc might be able to handle uploads if it's sitting behind Nginx/Apache acting as reverse proxy doing buffering? Or is it more like doing anything with big files in Arc is a no-go, so it's better to have a separate setup of Nginx/Apache (with PHP or whichever) handling file the uploads?

-----

3 points by aw 751 days ago | link

> So, for Nginx/Apache, are you suggesting Arc might be able to handle uploads if it's sitting behind Nginx/Apache acting as reverse proxy doing buffering?

Nope, that won't help.

> so it's better to have a separate setup of Nginx/Apache (with PHP or whichever) handling file the uploads

That's the easiest approach. Not that you'd need PHP, just pop in a module to handle file uploads for you.

> Or is it more like doing anything with big files in Arc is a no-go

Not Arc as such but the implementation in srv.arc isn't designed for large files. You could read the old MZScheme documentation at http://docs.racket-lang.org/mzscheme/index.html and figure out how to read an input stream into a binary buffer, but it would be more work.

-----

1 point by hjek 748 days ago | link

Thanks a lot for helping clear that up. Those limitations of Arc are definitely not immediately obvious from reading the docs and essays available on the language.

-----