update naming
This commit is contained in:
@@ -15,7 +15,7 @@ namespace MConnectSDK
|
||||
/// <summary>
|
||||
/// Client connessioni HTTP della classe
|
||||
/// </summary>
|
||||
private static readonly HttpClient cHttpClient = new HttpClient();
|
||||
private static readonly HttpClient cHttpClient = new HttpClient() { Timeout = TimeSpan.FromSeconds(300) };
|
||||
/// <summary>
|
||||
/// Test ping x indirizzo indicato
|
||||
/// </summary>
|
||||
@@ -257,15 +257,15 @@ namespace MConnectSDK
|
||||
/// <summary>
|
||||
/// Caricamento file come multipart in modalità async
|
||||
/// </summary>
|
||||
/// <param name="remotePath"></param>
|
||||
/// <param name="machineId"></param>
|
||||
/// <param name="fileName"></param>
|
||||
/// <param name="localFileName"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<string> ftpUploadAsync(string remotePath, string fileName, string localFileName)
|
||||
public static async Task<string> ftpUploadAsync(string machineId, string fileName, string localFileName)
|
||||
{
|
||||
// test: user=scm, pwd=viaemilia_2019
|
||||
string remoteFtpPath = @"ftp://fow.steamware.net/httpdocs/SCM/";
|
||||
Log.Instance.Info($"[ftpUploadAsync]: Calling FTP: {remoteFtpPath} | Remote Path {remotePath} | local file name: {localFileName}");
|
||||
Log.Instance.Info($"[ftpUploadAsync]: Calling FTP: {remoteFtpPath} | Remote Path {machineId} | local file name: {localFileName}");
|
||||
|
||||
GatewayPayload rispo = new GatewayPayload()
|
||||
{
|
||||
@@ -281,17 +281,18 @@ namespace MConnectSDK
|
||||
|
||||
// creo folder...
|
||||
DateTime adesso = DateTime.Now;
|
||||
ftpClient.createDirectory(remotePath);
|
||||
ftpClient.createDirectory($"{remotePath}/{adesso:yyMMdd_HHmmss}");
|
||||
ftpClient.createDirectory($"{adesso:yyyyMMdd}");
|
||||
ftpClient.createDirectory($"{adesso:yyyyMMdd}/{machineId}");
|
||||
ftpClient.createDirectory($"{adesso:yyyyMMdd}/{machineId}/{adesso:HHmmss}");
|
||||
|
||||
// genero nome remoto...
|
||||
string remFileName = $"{remotePath}/{adesso:yyMMdd_HHmmss}/{fileName}";
|
||||
string remFileName = $"{adesso:yyyyMMdd}/{machineId}/{adesso:HHmmss}/{fileName}";
|
||||
/* Upload a File */
|
||||
ftpClient.upload(remFileName, localFileName);
|
||||
// compogo risposta
|
||||
rispo = new GatewayPayload()
|
||||
{
|
||||
expiry = "1day",
|
||||
expiry = "2 days",
|
||||
link = "http://fow.steamware.net/SCM/" + remFileName,
|
||||
key = remFileName,
|
||||
error = "",
|
||||
|
||||
Reference in New Issue
Block a user