0

I've been making a program and one of the things I'm trying to do is be able to have my program take a file from its' resources and upload it to file.io. file.io is a simple file uploading website with a simple API, I'm just not sure how to use that API in my program. Once the file has been uploaded, I want to be able to get the link from the website. It's fairly simple but I'm unsure how to mimic the action of clicking the upload button and choosing my file, then grabbing the link. I know there's many posts all around about uploading files but honestly they confuse me and don't really relate to this situation. If someone knows a post that is similar to my issue and can help me, or can help me in any way I'd appreciate it a lot. If you need any details let me know.

DylanC
  • 41
  • 9
  • "If you need any details let me know." Please show some code of what you've already tried. – Adam Heeg Feb 03 '18 at 02:37
  • @AdamHeeg I haven't tried any code. I can't really find anything that helps me/relates to this situation. – DylanC Feb 03 '18 at 02:56
  • this isn't a code service site. Are you using a .net web technology? Maybe I can point to you a tutorial. – Adam Heeg Feb 03 '18 at 03:10

1 Answers1

1

Here ya go, their api is pretty straightforward:

    using (WebClient client = new WebClient())
    {
       var resStr = client.UploadFile("https://file.io", @"C:\data\test.txt");
       var jObjResult =  JObject.Parse(Encoding.UTF8.GetString(resStr));
       var linkToFile = jObjResult["link"];
    }
igorc
  • 2,024
  • 2
  • 17
  • 29