forked from zapadi/redmine-net-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Download file
alinach edited this page May 16, 2016
·
6 revisions
Download attachment file.
Sync Example:
using System;
using Redmine.Net.Api;
using Redmine.Net.Api.Types;
namespace RedmineTest
{
class Program
{
static void Main(string[] args)
{
string host = "<host>";
string apiKey = "<api-key>";
var manager = new RedmineManager(host, apiKey);
var url = host + "/attachments/download/" + "<attachment-id>" + "/" + "<attachment-file-name>";
var document = manager.DownloadFile(url);
if (document!= null)
Console.WriteLine("Document downloaded successfully.");
else
Console.WriteLine("Document is null.");
}
}
}
Async Example:
using System;
using Redmine.Net.Api;
using Redmine.Net.Api.Types;
using Redmine.Net.Api.Async;
using System.Threading.Tasks;
namespace RedmineTest
{
class Program
{
static RedmineManager manager;
static void Main(string[] args)
{
string host = "<host>";
string apiKey = "<api-key>";
manager = new RedmineManager(host, apiKey);
var document = DownloadFileAsync().Result;
if (document!= null)
Console.WriteLine("Document downloaded successfully.");
else
Console.WriteLine("Document is null.");
}
static async Task<byte[]> DownloadFileAsync()
{
var url = host + "/attachments/download/" + "<attachment-id>" + "/" + "<attachment-file-name>";
return await manager.DownloadFileAsync(url);
}
}
}
- Introduction
- Authentication
- User impersonation
- Using proxy
- CRUD Operations
- List Operations
- Specific operations
- Attachments - Upload file - Download file
- Issues - Add watcher to issue - Remove watcher from issue
- Users - Get current user
- Groups - Add user to group - Remove user from group
- Wiki pages - Get wiki page - Get all wiki pages - Create/Update wiki page - Delete wiki page