Bladeren bron

Bug fix

master
radivoje.milutinovic 3 jaren geleden
bovenliggende
commit
499b9c6a37

+ 1
- 1
SecureSharing.Data/Data/Message.cs Bestand weergeven

{ {
public string Text { get; set; } public string Text { get; set; }
public string Code { get; set; } public string Code { get; set; }
public List<FileModel> FileNames { get; set; }
public List<FileModel> FileNames { get; } = new();
public bool IsValid { get; set; } public bool IsValid { get; set; }
public DateTime? ExpiryDate { get; set; } public DateTime? ExpiryDate { get; set; }
} }

+ 5
- 2
SecureSharing/Controllers/HomeController.cs Bestand weergeven

[HttpPost] [HttpPost]
public async Task<IActionResult> CreateMessage(MessageModel model) public async Task<IActionResult> CreateMessage(MessageModel model)
{ {
if (string.IsNullOrWhiteSpace(model.Text) && model.Files.Count == 0 && string.IsNullOrEmpty(model.FilesAsText))
if (string.IsNullOrWhiteSpace(model.Text) && model.Files.Count == 0 && model.FilesAsText == "978682e8-3ce7-4258-b731-d027b5b213aa")
return Redirect("/"); return Redirect("/");


model.FilesAsText = model.FilesAsText != "978682e8-3ce7-4258-b731-d027b5b213aa"
? model.FilesAsText.Split("978682e8-3ce7-4258-b731-d027b5b213aa")[1]
: "";
var message = new MessageDto { Text = model.Text }; var message = new MessageDto { Text = model.Text };


await UploadFiles(model, message); await UploadFiles(model, message);
return View(model); return View(model);
} }



public IActionResult Privacy() public IActionResult Privacy()
{ {
return View(); return View();

+ 1
- 2
SecureSharing/Views/Home/Index.cshtml Bestand weergeven

<span style="color:#0D1C52">Drag and drop files here or</span> browse <span style="color:#0D1C52">Drag and drop files here or</span> browse
</label> </label>
<input asp-for="Files" id="fileInput" type="file" multiple style="display: none"/> <input asp-for="Files" id="fileInput" type="file" multiple style="display: none"/>
<input asp-for="FilesAsText" id="fileInputAsText" type="text" style="display:none"/>
<input asp-for="FilesAsText" id="fileInputAsText" type="text" style="display:none" value="978682e8-3ce7-4258-b731-d027b5b213aa"/>
</div> </div>
</div> </div>


Your files Your files
</div> </div>
<div id="filesUploaded"> <div id="filesUploaded">

</div> </div>


<button class=" btn btn-light share-button" type="submit">Share</button> <button class=" btn btn-light share-button" type="submit">Share</button>

+ 1
- 1
SecureSharing/Views/Home/Link.cshtml Bestand weergeven

@Model.MessageModel.Text @Model.MessageModel.Text
</div> </div>
} }
@if (Model.MessageModel.FileNames.Count > 0)
if (Model.MessageModel.FileNames.Count > 0)
{ {
<div class="label-text"> <div class="label-text">
Files: Files:

Laden…
Annuleren
Opslaan