...
This commit is contained in:
parent
a8c9b7619f
commit
c2f38800aa
6 changed files with 75 additions and 58 deletions
|
|
@ -20,20 +20,15 @@ namespace nuget_cli
|
|||
FileInfo fi = new FileInfo(pkg);
|
||||
if (!fi.Exists)
|
||||
throw new Exception("Le fichier n'existe pas");
|
||||
if (fi.Length > MAXSENDLEN)
|
||||
throw new Exception($"Le fichier ne passe pas, trop gros ({MAXSENDLEN}).");
|
||||
|
||||
var fparams = new Dictionary<string, string> { };
|
||||
|
||||
using (var fss = fi.OpenRead())
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
byte[] buffer = new byte[MAXSENDLEN];
|
||||
var form_bytes_read = fss.Read(buffer, 0, MAXSENDLEN);
|
||||
|
||||
report.UploadFilesToServer(new Uri(source),
|
||||
fparams, fi.Name, "application/octet-stream",
|
||||
apikey, buffer);
|
||||
fparams, fi, "application/octet-stream",
|
||||
apikey);
|
||||
|
||||
}
|
||||
catch (WebException ex)
|
||||
|
|
@ -52,7 +47,6 @@ namespace nuget_cli
|
|||
await Console.Error.WriteLineAsync(ex.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
report.Executed = true;
|
||||
return report;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue