I have established openstack swift connection with .net/ windows 8.1 app but i am unable to find any method to upload file or create object to openstack swift using windows 8.1 app / .net
Please help me how to upload file to openstack swift.
I have established openstack swift connection with .net/ windows 8.1 app but i am unable to find any method to upload file or create object to openstack swift using windows 8.1 app / .net
Please help me how to upload file to openstack swift.
I have developed a .Net Standard client for this, and implemented a WPF demo and ASP.NET Core demo. It includes authentication on OpenStack Identity, and most of actions for OpenStack switch:
I hope it is easy to use, in that case:
var c = new SwiftClient();
if(!await AuthenticateIfNeededAsync())
{
Log($"Could not authenticated: could not retrieve a valid token");
return;
}
c.InitToken(Token);
var file = System.IO.File.OpenRead(NewFileSource);
string contentType = "application/octet-stream";
contentType = MimeTypeMap.GetMimeType(System.IO.Path.GetExtension(NewFileSource));
var resp = await c.ObjectPutAsync(ObjectStoreUrl, Container, NewFileName, file, contentType);
There's no easy answer to this. I'm actually seriously considering writing a swift client library for .NET to help foster more .NET development against swift.
But as it stands, you have to interact with it just as you would any other random REST API that you don't have a library for:
The general flow of the session is:
Use curl
to test your API calls outside of your code to confirm what headers the requests require and what values they should have. If you don't have access to a Linux machine, you can install curl for windows, or get it with cygwin.
If you do this, please create github project and share it, if you can. You may find myself and others willing to jump in and help you!
Other alternatives: