Closed elfeck closed 8 years ago
The uploaded files are handled here: https://github.com/agrafix/Spock/blob/c13fc9bcade9afe11b008a1c20d9498bcee34d7b/src/Web/Spock/Internal/Wire.hs#L266 using the https://hackage.haskell.org/package/wai-extra-3.0.13/docs/Network-Wai-Parse.html package and the tempFileBackend
.
Ah okay, thanks! So it seems that WAI uses getTemporaryDirectory
from System.Directory
. But I can't find the temporary file which is supposed to be there. Any idea why?
Or more explicitly: When does the temporary file get deleted again?
The file will only live while the request is being processed and removed shortly after.
Is the file then hold in-memory or does it get moved somewhere else?
No, it's your responsibility to persist the file by for example copying it to a different location.
Okay, so after I call files
, I need to deal with it or else it vanishes. Makes sense. You can close this issue this is correct. Thanks for your help!
No worries, glad I could help!
Hi,
I am wondering how
files
andUploadedFile
work, especially, where the files "/tmp/webenXXXX.buf" is stored in the filesystem. I was trying to decipher the src in Spock but it I don't have a lot of knowledge of WAI. Can someone explain/point me to the right doc or src if no doc is available?Thanks!