How to implement "upload files" within Unity?

I wanna to upload files to “http” server within my project… I did not find a proper method to implement that.

For this it looks simple and valid ,but it reports that the class “System.Web.Services.Server” in my project when I used this code in my project…

Check out the Unity documentation: Unity - Manual: Uploading raw data to an HTTP server (PUT)

Does it need to add some server code for file saving in this way?

Of course you have to have a webserver that has some serverside logic that will accept file uploads and store them somewhere on the server. Either as files or in a database. However this has nothing to do with Unity. Webservers represent a standard interface and is essentially a line of seperation between two worlds.

The link that @glgamesforfun posted is about uploading files to a web server from Unity using the http method PUT. The link you posted in your OP was part of an ASP .NET server. What kind of server you have we don’t know. You could use anything as backend. Apache web server with PHP, a nodejs server, an asp server, …

Of course you have to host that server somewhere where it is reachable from your Unity application. Usually somewhere on the internet.

3 Likes