# Stream large file via HTTP

**URL:** <https://discourse.julialang.org/t/stream-large-file-via-http/103486>\
**Category:** Web Stack\
**Tags:** http, mmap, streaming\
**Created:** [September 3, 2023, 4:45pm UTC](https://discourse.julialang.org/t/stream-large-file-via-http/103486 "2023-09-03T16:45:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sschmidhuber](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sschmidhuber/32/13349_2.png) [@sschmidhuber](https://discourse.julialang.org/u/sschmidhuber)\
**Post date:** [September 3, 2023, 4:45pm UTC](https://discourse.julialang.org/t/stream-large-file-via-http/103486/1 "2023-09-03T16:45:57Z")

</div>

Hello all,  
my goal is to stream a large file via a HTTP GET request to a client. The file is potentially larger than my server’s memory. Related to that, I found the following on Stack Overflow: [stream - Send a large file with HTTP.jl - Stack Overflow](https://stackoverflow.com/questions/48989721/send-a-large-file-with-http-jl)

```julia
function testfun(req::HTTP.Request)
    data = Mmap.mmap(open("testfile.txt"), Array{UInt8,1})
    return HTTP.Response(200,data)
end

```

The file transfer (resp. download) works with that solution, but Julia still loads the whole file into memory. Is there a way in Julia / HTTP.jl to feed the file to the HTTP response as stream without loading the whole file into memory?

Thank you!
