Bug fix: Attachment
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
using OI.Metrology.Shared.Models;
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using System.Text.Json;
|
||||
using System.Web;
|
||||
|
||||
namespace OI.Metrology.Server.Repository;
|
||||
|
||||
@ -49,7 +50,9 @@ public class FileShareRepository : IFileShareRepository
|
||||
void IFileShareRepository.CopyFile(HttpClient httpClient, string from, string to)
|
||||
{
|
||||
Uri uri = GetEndPoint(httpClient, "copy-file");
|
||||
Task<HttpResponseMessage> httpResponseMessage = httpClient.GetAsync(uri);
|
||||
string encodedTo = HttpUtility.UrlEncode(to);
|
||||
string encodedFrom = HttpUtility.UrlEncode(from);
|
||||
Task<HttpResponseMessage> httpResponseMessage = httpClient.GetAsync($"{uri.OriginalString}?from={encodedFrom}&to={encodedTo}");
|
||||
httpResponseMessage.Wait();
|
||||
if (httpResponseMessage.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
throw new Exception(httpResponseMessage.Result.StatusCode.ToString());
|
||||
@ -58,7 +61,9 @@ public class FileShareRepository : IFileShareRepository
|
||||
void IFileShareRepository.MoveFile(HttpClient httpClient, string from, string to)
|
||||
{
|
||||
Uri uri = GetEndPoint(httpClient, "move-file");
|
||||
Task<HttpResponseMessage> httpResponseMessage = httpClient.GetAsync(uri);
|
||||
string encodedTo = HttpUtility.UrlEncode(to);
|
||||
string encodedFrom = HttpUtility.UrlEncode(from);
|
||||
Task<HttpResponseMessage> httpResponseMessage = httpClient.GetAsync($"{uri.OriginalString}?from={encodedFrom}&to={encodedTo}");
|
||||
httpResponseMessage.Wait();
|
||||
if (httpResponseMessage.Result.StatusCode != System.Net.HttpStatusCode.OK)
|
||||
throw new Exception(httpResponseMessage.Result.StatusCode.ToString());
|
||||
|
Reference in New Issue
Block a user