how to upload files?

Please post public support tickets here. Note: for private support tickets, please send an email to instead.
Posts: 1
Joined: Mon Nov 20, 2017 4:14 pm

how to upload files?

Postby maoming » Mon Nov 20, 2017 4:21 pm

cshtml5 how to upload files? Is there such an example? Thank you!

JS-Support @Userware
Site Admin
Posts: 1023
Joined: Tue Apr 08, 2014 3:42 pm

Re: how to upload files?

Postby JS-Support @Userware » Wed Nov 22, 2017 6:12 am

Hi and welcome to the forums.

Uploading a file with CSHTML5 works the same as in Silverlight. Most of the required work in done server-side. For example, if your server is based on, you can create a IHttpHandler that receives the file. On the client side, all you have to do is call the method "WebClient.UploadString(Uri address, string data)".

For a complete tutorial, please read the following page:

The only difference in CSHTML5 compared to the tutorial above is that you need to replace "WebClient.OpenWrite" with "WebClient.UploadString" because "WebClient.OpenWrite" is not yet supported in CSHTML5 at the time of writing.

If you follow the tutorial and run into any issues, please feel free to post a simple VS project that reproduces the issue and we will look into your issues.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 4 guests