C# Upload files to Wix Media Cloud

A few months back, Wix released it’s beta version of Cloud Media Platform.
The service gives Microsoft’s Media Services, which rules the web in the Media encoding and post-processing, a run for their money.
While Microsoft uses their own cloud for the job, Wix is working on Google Cloud Platform to deliver their solution. The process is using the WixMP, which is very simple and requires just a Google Account to get the 2GB Cloud Storage free plan. Other pricing plans are also available.
Currently, Wix are offering SDK versions only for Javascript (Some features are only available to Node.js) and Python, and I don’t believe there will be any SDK for C#.
So to make a short story even shorter, I wrote a small helper to generate url’s to upload files from code.

In order to get the Upload url, you need to get a token from the Wix media servers,
the process is very straight forward and you can read all about it here.
To obtain the token you need your Wix API Key and Wix API Secret from the platform dashboard.

Now with this helper that you can put in your code behind, calling

will return a url for uploading you can give back to the browser or add upload from server.
to build a form data request you will need this three keys
1. “media_type” : the type of media you want.
2. “file” : the file.
3. “user_id” : Wix API Key.

You can also reuse

in your own function, with other URI’s, to do more with the cloud API.
Good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *