public void UploadFile(Stream stream, string workflowId_) { var parser = MultipartFormDataParser.Parse(stream); string typology = parser.GetParameterValue("typology"); //separate by , string clients = parser.GetParameterValue("clients"); // separate by , bool standard = bool.Parse(parser.GetParameterValue("packStandard")); //string "true" "false" // Files are stored in a list: FilePart file = parser.Files.First(); string FileName = file.FileName; int workflowId = int.Parse(workflowId_); //EST CE QUE LE DOSSIER TEMP EXISTE if (Directory.Exists(ParamAppli.DossierTemporaire) == false) { Directory.CreateDirectory(ParamAppli.DossierTemporaire); } string FilePath = Path.Combine(ParamAppli.DossierTemporaire, FileName); using (FileStream fileStream = File.Create(FilePath)) { file.Data.Seek(0, SeekOrigin.Begin); file.Data.CopyTo(fileStream); } GereMDBDansBDD gestionMDBdansBDD = new GereMDBDansBDD(); //AJOUT DU ZIP DE MDB DANS LA BDD gestionMDBdansBDD.AjouteZipBDD(FilePath, workflowId, ParamAppli.ConnectionStringBaseAppli); string clientToLaunch = ""; //Bring all client if ((String.IsNullOrEmpty(clients) || clients == "undefined") && !String.IsNullOrEmpty(typology)) { //REQUETE int typologyId = Int32.Parse(typology); IEnumerable <InfoClient> listClient = RequestTool.getClientsWithTypologies(typologyId); foreach (InfoClient client in listClient) { clientToLaunch = clientToLaunch + client.ID_CLIENT + ","; } clientToLaunch = clientToLaunch.Remove(clientToLaunch.Length - 1); } else if (!String.IsNullOrEmpty(clients) && !String.IsNullOrEmpty(typology)) { //Récupérer les clients du front clientToLaunch = clients; } else { //GENERATE EXCEPTION throw new Exception(); } //Launch process LaunchProcess(ParamAppli.ProcessControlePacks, workflowId, clientToLaunch); //SUPPRESSION DU FICHIER File.Delete(FilePath); }