devkitPro / libctru

Homebrew development library for Nintendo 3DS/Horizon OS user mode (Arm11)

Home Page:https://libctru.devkitpro.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] Simple "downloadFile()" function

ThatNerdyPikachu opened this issue · comments

commented

I would like this added since the current method of downloading files is crazy.

The http_download(const char *url) function in this example provides what you want already.

commented

Closing. libctru is not supposed to be a kitchen sink of random utility functions. The example projects exist for a reason.

commented

@deltabeard the example project is... deleted?

It seems to have moved to here. All the ctrulib examples may be found here.

commented

But I want the content of it, I tried this example but it just tells me some stuff like the content size... I just want the content of it.

The example application does get the content (using httpcDownloadData()) and it stores the downloaded data in memory in a buffer called buf (which after download the example tries writing to the framebuffer). If you want to write it to a file, you can use fwrite.
Although I don't think the file the example is trying to download exists anymore.

Correct me if I am wrong.

@deltabeard example lives here: https://github.com/devkitPro/3ds-examples/tree/master/network/http

@oreo639 yes, that example's url gives me a 404.

Additionally, we now have a curl portlib.

@mtheall Thank you for linking the source code. I linked the documentation deliberately in this case.

commented

This still doesn't work for me tho.

Could you be a little more description with what isn't actually working for you please?