Hi,
Would I load the Nuget for this into the Application, Core, or EntitiyFrameworkCore Projects?
Here is my code that I used...
_createorEditModal has the following :
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">
Drag n' drop uploader
</div>
</div>
<form id="upload-widget" method="post" class="dropzone" enctype="multipart/form-data" required>
</form>
</div>
</div>
</div>
_CreateOrEditModal.js has the following: you will see it returns the saved documents Id
$(document).ready(function () {
Dropzone.autoDiscover = false;
$(".dropzone").dropzone({
url: "/App/Documents/UploadDocument/",
uploadMultiple: false,
paramName: "file",
parallelUploads: 1,
maxFiles: 1,
headers: {
"X-XSRF-TOKEN": abp.security.antiForgery.getToken()
},
success: function (file, response) {
$('#form').append('<input type="hidden" name="DocumentId" value="' + response.result.id + '" />');
}
});
});
the Document controller:
[HttpPost]
[AllowAnonymous]
public ActionResult UploadDocument()
{
try
{
var documentFile = Request.Form.Files.First();
string ext = Path.GetExtension(documentFile.FileName);
//Check input
if (documentFile == null)
throw new UserFriendlyException(L("File_Empty_Error"));
byte[] fileBytes;
using (var stream = documentFile.OpenReadStream())
{
fileBytes = stream.GetAllBytes();
}
var documentFileObject = new BinaryObject(AbpSession.GetTenantId(), fileBytes);
_binaryObjectManager.SaveAsync(documentFileObject);
return Json(new AjaxResponse(new {id = documentFileObject.Id }));
}
catch (UserFriendlyException ex)
{
return Json(new AjaxResponse(new ErrorInfo(ex.Message)));
}
}
Thanks - will give it a try
Super excited to see this release when will it be launched this week?
Brilliant - thanks so much!
WIll I have to do something like below or is their an easier way?
private IQueryable<AuditLogAndUser> CreateAuditLogAndUsersQuery(GetAuditLogsInput input)
{
var query = from auditLog in _auditLogRepository.GetAll()
join user in _userRepository.GetAll() on auditLog.UserId equals user.Id into userJoin
from joinedUser in userJoin.DefaultIfEmpty()
where auditLog.ExecutionTime >= input.StartDate && auditLog.ExecutionTime <= input.EndDate
select new AuditLogAndUser {AuditLog = auditLog, User = joinedUser};
query = query
.WhereIf(!input.UserName.IsNullOrWhiteSpace(), item => item.User.UserName.Contains(input.UserName))
.WhereIf(!input.ServiceName.IsNullOrWhiteSpace(), item => item.AuditLog.ServiceName.Contains(input.ServiceName))
.WhereIf(!input.MethodName.IsNullOrWhiteSpace(), item => item.AuditLog.MethodName.Contains(input.MethodName))
.WhereIf(!input.BrowserInfo.IsNullOrWhiteSpace(), item => item.AuditLog.BrowserInfo.Contains(input.BrowserInfo))
.WhereIf(input.MinExecutionDuration.HasValue && input.MinExecutionDuration > 0, item => item.AuditLog.ExecutionDuration >= input.MinExecutionDuration.Value)
.WhereIf(input.MaxExecutionDuration.HasValue && input.MaxExecutionDuration < int.MaxValue, item => item.AuditLog.ExecutionDuration <= input.MaxExecutionDuration.Value)
.WhereIf(input.HasException == true, item => item.AuditLog.Exception != null && item.AuditLog.Exception != "")
.WhereIf(input.HasException == false, item => item.AuditLog.Exception == null || item.AuditLog.Exception == "");
return query;
}
Awesome - Thanks - that was the trick :D
Hi Any idea of when the subscribe for SaaS services (editions) and pay it with payPal will be released?
Brilliant - that worked Thanks!
I have since changed the following line, but still not working
var project = input.Project.MapTo<Project>();