diff --git a/Database/Database-Documents.cs b/Database/Database-Documents.cs index d8bd501c..0eb275e0 100644 --- a/Database/Database-Documents.cs +++ b/Database/Database-Documents.cs @@ -75,7 +75,7 @@ namespace Swarmops.Database DbCommand command = GetDbCommand( "SELECT Documents.DocumentId,Documents.ServerFileName,Documents.ClientFileName,Documents.Description,DocumentTypes.Name AS DocumentType,Documents.ForeignId,Documents.FileSize,Documents.UploadedByPersonId,Documents.UploadedDateTime From Documents,DocumentTypes " + - "WHERE Documents.Description = '" + description.Replace ("'", "''") + " AND " + + "WHERE Documents.Description = '" + description.Replace ("'", "''") + "' AND " + "Documents.UploadedDateTime > '" + DateTime.UtcNow.AddDays(-1).ToString("yyyy-MM-dd HH:mm") + "'", connection); using (DbDataReader reader = command.ExecuteReader()) diff --git a/Site5/Automation/UploadFileHandler.ashx b/Site5/Automation/UploadFileHandler.ashx index 31ef09ea..cefdd35b 100644 --- a/Site5/Automation/UploadFileHandler.ashx +++ b/Site5/Automation/UploadFileHandler.ashx @@ -224,7 +224,7 @@ namespace Swarmops.Frontend.Automation file.InputStream.Position = 0; file.SaveAs (StorageRoot + fileFolder + Path.DirectorySeparatorChar + fileName); - Document.Create (StorageRoot + fileFolder + Path.DirectorySeparatorChar + fileName, file.FileName, file.ContentLength, + Document.Create (fileFolder + Path.DirectorySeparatorChar + fileName, file.FileName, file.ContentLength, guid, null, authData.CurrentUser); statuses.Add (new FilesStatus (fullName, file.ContentLength));