Search code examples
c#file-uploadwindows-server

Uploading a file in C# to windows server - how to best set up server & client?


I'm completely new to Windows servers and uploading to a server in general, so sorry if this is a rather trivial question.

I want to upload a file from a C# client to a windows server, where the file will be accessible via HTTP. I have full access to the server, I do however need to set it up (IIS already has one site running on localhost). What would be the safest / best way to upload a file to this server (possibly without revealing Username/password), and how would I set the server up? Any links to tutorials are welcome. If I understand correctly, FTP isn't the best way to handle this?

Edit: The application only runs in a controlled environment, so granting the application full read/write access to the server should be no problem at all.


Solution

  • There are many options.

    If the client doing the uploading is outside your network:

    • HTTP upload using an HTTPS connection. Require login so that not everyone can upload their own version of the file, or
    • SFTP. You will need third-party SFTP software (a shame Windows still does not include that). Filezilla is open source and works fine on Windows.

    If the client doing the uploading is in your network: