Will Racket's pleasant surprises never end? :) This is great news! I've had a blast coding web applications in Racket over the last 15 months. I now understand "The Lisp Curse" a bit more :)
http://winestockwebdesign.com/Essays/Lisp_Curse.html In other words, developing web apps with what is already provided by Racket, and a few packages, has been easy & enjoyable enough that it's delayed my work on a web framework. That's probably been for the best because now I have a few real world examples from which I can begin to extract the code that belongs in a general framework. I'll be resuming that work this month. I watched the "how to create a blog in 15 minutes w/ Rails" video 14 years ago, and it had a huge impact on my work. There are still some very nice things to steal from Rails, and a whole lot of things to leave :) If you're interested in web development, and you haven't seen this video, I highly recommend it. There are some annoyances for sure, but be patient. https://www.youtube.com/watch?v=Gzj723LkRJY&feature=youtu.be On Thursday, February 13, 2020 at 11:02:33 AM UTC-5, bogdan wrote: > > The version of the web-server that will be included with Racket 7.6 > changes the way file uploads are handled so that they get offloaded to > disk after a certain threshold (similar to how that nginx module you > linked to works). > > You can check out the pre-release docs for details: > > * > https://pre-release.racket-lang.org/doc/web-server/http.html?q=binding%3Afile#%28def._%28%28lib._web-server%2Fhttp%2Frequest-structs..rkt%29._make-binding~3afile%2Fport%29%29 > > * > https://pre-release.racket-lang.org/doc/web-server-internal/dispatch-server-unit.html#%28part._safety-limits%29 > > > To get these changes ahead of the release, you should be able to install > an updated version of `web-server-lib' from the package server or from > git. > > Hope that helps! > > - Bogdan > > Brian Adkins writes: > > > I'm posting a file to my web app using the following form: > > > > <form accept-charset="UTF-8" action="@(url-for 'upload-contacts > > (organization-id org-obj))" > > method="post" *enctype="multipart/form-data"* > > class="file-upload-form"> > > ... > > </form> > > > > I use a simple function to create a hashtable of attributes: > > > > (define (form-values req) > > (for/hash ([ b (in-list (request-bindings/raw req)) ]) > > (cond [ (binding:form? b) (values > > (bytes->string/utf-8 (binding-id b) > #\space) > > (bytes->string/utf-8 (binding:form-value > b) > > #\space)) ] > > [ (binding:file? b) (values > > (bytes->string/utf-8 (binding-id b) > #\space) > > (binding:file-content b)) ]))) > > > > It appears that the entire file contents are in the binding by the time > the > > request is available to me. This is fine for "small enough" files, but > for > > larger files, it would be great to be able to stream the file contents. > The > > solution may be to use something like nginx's upload module: > > > > https://www.nginx.com/resources/wiki/modules/upload/ > > > > But before I go down that route, I thought I'd ask if the Racket web > server > > provides a more direct way to accomplish this. > > > > Thanks, > > Brian > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/d9c81358-1e32-438e-88cb-433bdd71ebd2%40googlegroups.com.