Click here to Skip to main content
15,616,520 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to My experience has been on winforms using, and I have been struggling with my first api call. I am using VS 2019. I spent a few hours researching but couldn't find what I need. I want to upload a file to a web api and then access that file on the server. I tried using <httppost> but got errors. The GetValues is successfully called, but is this what I need?

What I have tried:

<form action="/api/Values " >	
	<!-- method="post" enctype="multipart/form-data" -->

            <input type="file" id="btn_FileUpload" name="btn_FileUpload"
                   class="btn btn-primary">

            <input type="submit" id="btn_submit" name="btn_submit">


Public Class ValuesController
    Inherits ApiController

    Public Function GetValues() As IEnumerable(Of String)

	    I want to get the file here

        Return New String() {"value1", "value2"}
    End Function

End Class
Updated 20-Aug-21 11:56am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900