{"id":438,"date":"2022-09-02T15:01:09","date_gmt":"2022-09-02T15:01:09","guid":{"rendered":"https:\/\/www.vdocipher.com\/blog\/?p=438"},"modified":"2025-11-06T06:44:55","modified_gmt":"2025-11-06T06:44:55","slug":"c-sample-video-upload-from-browser-to-vdocipher","status":"publish","type":"post","link":"https:\/\/www-uat.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/","title":{"rendered":"C# sample API for video upload from browser to VdoCipher"},"content":{"rendered":"<p>To automate your video\u00a0website platform, you need video upload directly through your website. <a href=\"https:\/\/www.vdocipher.com\/blog\/2016\/02\/video-upload-using-api\/\" target=\"_blank\" rel=\"noopener\">Read this for details\u00a0about\u00a0this method<\/a>.\u00a0The following code gives an\u00a0example written in C#.<\/p>\n<h2>C# Sample Code\u200b for VdoCipher OTP Generation<\/h2>\n<p>In this example, the sample videoID is 1234567890, and the API Secret Key is a1b2c3d4e5. The time-to-live for OTP validity is set to 300s in the sample code. You can reference the API documentation for more info.<br \/>\n<code><br \/>\nvar client = new RestClient(\"https:\/\/dev.vdocipher.com\/api\/videos\/1234567890\/otp\");<br \/>\nvar request = new RestRequest(Method.POST);<br \/>\nrequest.AddHeader(\"Accept\", \"application\/json\");<br \/>\nrequest.AddHeader(\"Content-Type\", \"application\/json\");<br \/>\nrequest.AddHeader(\"Authorization\", \"Apisecret a1b2c3d4e5\");<br \/>\nrequest.AddParameter(\"undefined\", \"{\\n\\t\\\"ttl\\\":300\\n}\", ParameterType.RequestBody);<br \/>\nIRestResponse response = client.Execute(request);<\/code><\/p>\n<p>The controller makes an API request to <a href=\"https:\/\/www.vdocipher.com\/docs\/server\/\">VdoCipher Video API<\/a> to get authorized data about the upload. View file creates the HTML form required for uploading data. Note that the HTML form is only for illustration. You need to hide the extra input fields and perhaps use one of the better javascript libraries (<a href=\"https:\/\/github.com\/danialfarid\/ng-file-upload\" target=\"_blank\" rel=\"noopener\">angularjs<\/a>, <a href=\"https:\/\/github.com\/blueimp\/jQuery-File-Upload\" target=\"_blank\" rel=\"noopener\">jquery<\/a> or <a href=\"http:\/\/www.dropzonejs.com\/\">standalone<\/a>, etc.) for video upload to make\u00a0user flow better according to rest of your website.<\/p>\n<p><a href=\"https:\/\/gist.github.com\/vibhavsinha\/cb35c43b874e52c69dd2\">https:\/\/gist.github.com\/vibhavsinha\/cb35c43b874e52c69dd2<\/a><\/p>\n<p>After\u00a0the video is uploaded, it is not ready instantly. Do not load the player immediately. Use the API to query when video is ready and only then\u00a0render the video player. The API for querying video status is described\u00a0in the <a href=\"https:\/\/www.vdocipher.com\/page\/api\/\" target=\"_blank\" rel=\"noopener\">API reference<\/a> as videos.<\/p>\n<h2>FAQs<\/h2>\n<h3>How to protect your C# video streaming on the backend?<\/h3>\n<p>The security integration of video streaming, like multi-DRM, is not directly available for C# use. The easiest solution would be to use a secure video streaming service provider like VdoCipher and integrate with their APIs compatible with the C# backend.<\/p>\n<h3>How to secure API in C#?<\/h3>\n<p>API gets used as a documented method of interacting with other services, and that is why there is no exact answer to the question, but applying OAuth and using a shared secret along with the request made can work as generic solutions.<\/p>\n<h3>Is C# vulnerable to Video Security lapses?<\/h3>\n<p>No, it has nothing to do with video security, as videos get secured through cloud encoding and global distribution via a dynamic key exchange mechanism.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To automate your video\u00a0website platform, you need video upload directly through your website. Read this for details\u00a0about\u00a0this method.\u00a0The following code gives an\u00a0example written in C#. C# Sample Code\u200b for VdoCipher OTP Generation In this example, the sample videoID is 1234567890, and the API Secret Key is a1b2c3d4e5. The time-to-live for OTP validity is set to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46,56,14],"tags":[83,84,18,85],"class_list":{"0":"post-438","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-api","7":"category-asp","8":"category-using-vdocipher","9":"tag-c-vdocipher","10":"tag-c-video-embed","11":"tag-v2","12":"tag-video-embed-api","13":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.0 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>C# sample API for video upload from browser to VdoCipher - VdoCipher Blog<\/title>\n<meta name=\"description\" content=\"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# sample API for video upload from browser to VdoCipher\" \/>\n<meta property=\"og:description\" content=\"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\" \/>\n<meta property=\"og:site_name\" content=\"VdoCipher Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vdociphertech\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-02T15:01:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-06T06:44:55+00:00\" \/>\n<meta name=\"author\" content=\"Vibhav Sinha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vdocipher\" \/>\n<meta name=\"twitter:site\" content=\"@vdocipher\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vibhav Sinha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\"},\"author\":{\"name\":\"Vibhav Sinha\",\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/person\/44b7d612191edc5560c5cb64184d379c\"},\"headline\":\"C# sample API for video upload from browser to VdoCipher\",\"datePublished\":\"2022-09-02T15:01:09+00:00\",\"dateModified\":\"2025-11-06T06:44:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\"},\"wordCount\":348,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#organization\"},\"keywords\":[\"C# vdocipher\",\"C# video embed\",\"v2\",\"video embed api\"],\"articleSection\":[\"APIs and Sample Codes\",\"ASP\",\"Using VdoCipher\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\",\"url\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\",\"name\":\"C# sample API for video upload from browser to VdoCipher - VdoCipher Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#website\"},\"datePublished\":\"2022-09-02T15:01:09+00:00\",\"dateModified\":\"2025-11-06T06:44:55+00:00\",\"description\":\"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www-uat.vdocipher.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# sample API for video upload from browser to VdoCipher\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#website\",\"url\":\"https:\/\/www-uat.vdocipher.com\/blog\/\",\"name\":\"VdoCipher Blog\",\"description\":\"Secure Video Streaming\",\"publisher\":{\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www-uat.vdocipher.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#organization\",\"name\":\"VdoCipher\",\"url\":\"https:\/\/www-uat.vdocipher.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vdocipher.com\/blog\/wp-content\/uploads\/2016\/11\/VdoCipher-logo2.png\",\"contentUrl\":\"https:\/\/www.vdocipher.com\/blog\/wp-content\/uploads\/2016\/11\/VdoCipher-logo2.png\",\"width\":1625,\"height\":1925,\"caption\":\"VdoCipher\"},\"image\":{\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vdociphertech\/\",\"https:\/\/x.com\/vdocipher\",\"https:\/\/www.linkedin.com\/company\/vdocipher\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/person\/44b7d612191edc5560c5cb64184d379c\",\"name\":\"Vibhav Sinha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21359ad936924de4c06b12ee192755a4337f15761710afc5877a6f943f1c8a47?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21359ad936924de4c06b12ee192755a4337f15761710afc5877a6f943f1c8a47?s=96&r=g\",\"caption\":\"Vibhav Sinha\"},\"description\":\"(Co-Founder &amp; CTO) Brain behind all VdoCipher innovations, Vibhav eats and sleeps code. A physics and astronomy enthusiast; Vibhav actively works on video delivery technology, security and high volume data transfer using cloud.\",\"url\":\"https:\/\/www-uat.vdocipher.com\/blog\/author\/vibhavsinha\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"C# sample API for video upload from browser to VdoCipher - VdoCipher Blog","description":"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/","og_locale":"en_US","og_type":"article","og_title":"C# sample API for video upload from browser to VdoCipher","og_description":"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.","og_url":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/","og_site_name":"VdoCipher Blog","article_publisher":"https:\/\/www.facebook.com\/vdociphertech\/","article_published_time":"2022-09-02T15:01:09+00:00","article_modified_time":"2025-11-06T06:44:55+00:00","author":"Vibhav Sinha","twitter_card":"summary_large_image","twitter_creator":"@vdocipher","twitter_site":"@vdocipher","twitter_misc":{"Written by":"Vibhav Sinha","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#article","isPartOf":{"@id":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/"},"author":{"name":"Vibhav Sinha","@id":"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/person\/44b7d612191edc5560c5cb64184d379c"},"headline":"C# sample API for video upload from browser to VdoCipher","datePublished":"2022-09-02T15:01:09+00:00","dateModified":"2025-11-06T06:44:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/"},"wordCount":348,"commentCount":0,"publisher":{"@id":"https:\/\/www-uat.vdocipher.com\/blog\/#organization"},"keywords":["C# vdocipher","C# video embed","v2","video embed api"],"articleSection":["APIs and Sample Codes","ASP","Using VdoCipher"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/","url":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/","name":"C# sample API for video upload from browser to VdoCipher - VdoCipher Blog","isPartOf":{"@id":"https:\/\/www-uat.vdocipher.com\/blog\/#website"},"datePublished":"2022-09-02T15:01:09+00:00","dateModified":"2025-11-06T06:44:55+00:00","description":"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.","breadcrumb":{"@id":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vdocipher.com\/blog\/2022\/09\/c-sample-video-upload-from-browser-to-vdocipher\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www-uat.vdocipher.com\/blog\/"},{"@type":"ListItem","position":2,"name":"C# sample API for video upload from browser to VdoCipher"}]},{"@type":"WebSite","@id":"https:\/\/www-uat.vdocipher.com\/blog\/#website","url":"https:\/\/www-uat.vdocipher.com\/blog\/","name":"VdoCipher Blog","description":"Secure Video Streaming","publisher":{"@id":"https:\/\/www-uat.vdocipher.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www-uat.vdocipher.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www-uat.vdocipher.com\/blog\/#organization","name":"VdoCipher","url":"https:\/\/www-uat.vdocipher.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.vdocipher.com\/blog\/wp-content\/uploads\/2016\/11\/VdoCipher-logo2.png","contentUrl":"https:\/\/www.vdocipher.com\/blog\/wp-content\/uploads\/2016\/11\/VdoCipher-logo2.png","width":1625,"height":1925,"caption":"VdoCipher"},"image":{"@id":"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vdociphertech\/","https:\/\/x.com\/vdocipher","https:\/\/www.linkedin.com\/company\/vdocipher"]},{"@type":"Person","@id":"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/person\/44b7d612191edc5560c5cb64184d379c","name":"Vibhav Sinha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-uat.vdocipher.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21359ad936924de4c06b12ee192755a4337f15761710afc5877a6f943f1c8a47?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21359ad936924de4c06b12ee192755a4337f15761710afc5877a6f943f1c8a47?s=96&r=g","caption":"Vibhav Sinha"},"description":"(Co-Founder &amp; CTO) Brain behind all VdoCipher innovations, Vibhav eats and sleeps code. A physics and astronomy enthusiast; Vibhav actively works on video delivery technology, security and high volume data transfer using cloud.","url":"https:\/\/www-uat.vdocipher.com\/blog\/author\/vibhavsinha\/"}]}},"yoast":{"focuskw":"C# sample API","title":"","metadesc":"The controller makes an API request to VdoCipher API to get authorized data about the upload. View file creates the HTML form required for uploading data.","linkdex":"63","metakeywords":"","meta-robots-noindex":"","meta-robots-nofollow":"","meta-robots-adv":"","canonical":"","redirect":"","opengraph-title":"","opengraph-description":"","opengraph-image":"","twitter-title":"","twitter-description":"","twitter-image":""},"_links":{"self":[{"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":4,"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"predecessor-version":[{"id":20443,"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions\/20443"}],"wp:attachment":[{"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www-uat.vdocipher.com\/blog\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}