I have added code
Configure<AbpClockOptions>(options => { options.Kind = DateTimeKind.Utc; // Ensure backend saves in UTC });
in my ProjectModule.cs
my Project Configuration Is
- Template: app-nolayers
after this i have given permission to roles we have . now i suppose to get Timezone drop down so that we can save timezone with User? Or it will work by default based on User browser time zone?
Can you please explain about this?
we need to save datetime data in UTC but based on user time zone or Browser timezone the datetime data should present on UI accordingly.
Point 1 and 2 checked and implemented For point 3 -- the downloaded project have build error so i updated i can attach the version information here ElsaDemoApp.Server.csproj.txt
Hi, I am trying to run ElsaDemoApp downloaded from documentation, i intalled Rabitq service and its running. But when trying to run application i am getting error in server.exe
RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.AggregateException: One or more errors occurred. (Connection failed, host 127.0.0.1:5672) ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed, host 127.0.0.1:5672 ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) --- End of stack trace from previous location --- at RabbitMQ.Client.Impl.SocketFactory.ConnectUsingAddressFamilyAsync(IPEndPoint endpoint, Func
2 socketFactory, AddressFamily family, TimeSpan connectionTimeout, CancellationToken cancellationToken) --- End of inner exception stack trace --- at RabbitMQ.Client.Impl.SocketFactory.ConnectUsingAddressFamilyAsync(IPEndPoint endpoint, Func2 socketFactory, AddressFamily family, TimeSpan connectionTimeout, CancellationToken cancellationToken) at RabbitMQ.Client.Impl.SocketFactory.OpenAsync(AmqpTcpEndpoint amqpTcpEndpoint, Func2 socketFactory, TimeSpan connectionTimeout, CancellationToken cancellationToken) at RabbitMQ.Client.Impl.SocketFrameHandler.CreateAsync(AmqpTcpEndpoint amqpTcpEndpoint, Func2 socketFactory, TimeSpan connectionTimeout, CancellationToken cancellationToken) at RabbitMQ.Client.ConnectionFactory.CreateFrameHandlerAsync(AmqpTcpEndpoint endpoint, CancellationToken cancellationToken) at RabbitMQ.Client.EndpointResolverExtensions.SelectOneAsync[T](IEndpointResolver resolver, Func3 selector, CancellationToken cancellationToken) --- End of inner exception stack trace --- at RabbitMQ.Client.EndpointResolverExtensions.SelectOneAsync[T](IEndpointResolver resolver, Func3 selector, CancellationToken cancellationToken) at RabbitMQ.Client.ConnectionFactory.CreateConnectionAsync(IEndpointResolver endpointResolver, String clientProvidedName, CancellationToken cancellationToken) --- End of inner exception stack trace --- at RabbitMQ.Client.ConnectionFactory.CreateConnectionAsync(IEndpointResolver endpointResolver, String clientProvidedName, CancellationToken cancellationToken) at Volo.Abp.RabbitMQ.ConnectionPool.GetConnectionAsync(String connectionName, ConnectionFactory connectionFactory) at Volo.Abp.RabbitMQ.ConnectionPool.GetAsync(String connectionName) at Volo.Abp.RabbitMQ.RabbitMqMessageConsumer.TryCreateChannelAsync() [16:04:22 INF] Initialized all ABP modules. [16:04:22 INF] Starting ElsaDemoApp. [16:04:30 ERR] The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 2s ago, v: 2.7.27.49176, command=HMGET, timeout: 5000, inst: 0, qu: 1, qs: 0, aw: False, bw: CheckingForTimeout, rs: NotStarted, ws: Idle, in: 0, last-in: 0, cur-in: 0, sync-ops: 0, async-ops: 3, serverEndpoint: 127.0.0.1:6379, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: VBI-VDI-00HK(SE.Redis-v2.7.27.49176), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=32765,Min=8,Max=32767), POOL: (Threads=7,QueuedItems=0,CompletedItems=164,Timers=7), v: 2.7.27.49176 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) StackExchange.Redis.RedisConnectionException: The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 2s ago, v: 2.7.27.49176, command=HMGET, timeout: 5000, inst: 0, qu: 1, qs: 0, aw: False, bw: CheckingForTimeout, rs: NotStarted, ws: Idle, in: 0, last-in: 0, cur-in: 0, sync-ops: 0, async-ops: 3, serverEndpoint: 127.0.0.1:6379, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: VBI-VDI-00HK(SE.Redis-v2.7.27.49176), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=2,Free=32765,Min=8,Max=32767), POOL: (Threads=7,QueuedItems=0,CompletedItems=164,Timers=7), v: 2.7.27.49176 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) ---> StackExchange.Redis.RedisConnectionException: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 2s ago, v: 2.7.27.49176 --- End of inner exception stack trace --- at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetStringAsync(IDistributedCache cache, String key, CancellationToken token) at Volo.Abp.FeatureManagement.StaticFeatureSaver.SaveAsync() at Volo.Abp.FeatureManagement.StaticFeatureSaver.SaveAsync() at Volo.Abp.FeatureManagement.FeatureDynamicInitializer.<>c__DisplayClass10_0.<<SaveStaticFeaturesToDatabaseAsync>b__1>d.MoveNext() --- End of stack trace from previous location --- at Polly.AsyncPolicy.<>c__DisplayClass44_0.<<ImplementationAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func3 action, Context context, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates1 shouldRetryResultPredicates, Func5 onRetryAsync, CancellationToken cancellationToken, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func4 sleepDurationProvider, Boolean continueOnCapturedContext) [16:04:30 ERR] The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 2s ago, v: 2.7.27.49176, command=HMGET, timeout: 5000, inst: 0, qu: 0, qs: 0, aw: False, bw: CheckingForTimeout, rs: NotStarted, ws: Idle, in: 0, last-in: 0, cur-in: 0, sync-ops: 0, async-ops: 3, serverEndpoint: 127.0.0.1:6379, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: VBI-VDI-00HK(SE.Redis-v2.7.27.49176), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=3,Free=32764,Min=8,Max=32767), POOL: (Threads=7,QueuedItems=0,CompletedItems=164,Timers=7), v: 2.7.27.49176 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) StackExchange.Redis.RedisConnectionException: The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 2s ago, v: 2.7.27.49176, command=HMGET, timeout: 5000, inst: 0, qu: 0, qs: 0, aw: False, bw: CheckingForTimeout, rs: NotStarted, ws: Idle, in: 0, last-in: 0, cur-in: 0, sync-ops: 0, async-ops: 3, serverEndpoint: 127.0.0.1:6379, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: VBI-VDI-00HK(SE.Redis-v2.7.27.49176), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=3,Free=32764,Min=8,Max=32767), POOL: (Threads=7,QueuedItems=0,CompletedItems=164,Timers=7), v: 2.7.27.49176 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) ---> StackExchange.Redis.RedisConnectionException: UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 2s ago, v: 2.7.27.49176 --- End of inner exception stack trace --- at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetStringAsync(IDistributedCache cache, String key, CancellationToken token) at Volo.Abp.PermissionManagement.StaticPermissionSaver.SaveAsync() at Volo.Abp.PermissionManagement.StaticPermissionSaver.SaveAsync() at Volo.Abp.PermissionManagement.PermissionDynamicInitializer.<>c__DisplayClass10_0.<<SaveStaticPermissionsToDatabaseAsync>b__1>d.MoveNext() --- End of stack trace from previous location --- at Polly.AsyncPolicy.<>c__DisplayClass44_0.<<ImplementationAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at Polly.Retry.AsyncRetryEngine.ImplementationAsync[TResult](Func3 action, Context context, ExceptionPredicates shouldRetryExceptionPredicates, ResultPredicates1 shouldRetryResultPredicates, Func5 onRetryAsync, CancellationToken cancellationToken, Int32 permittedRetryCount, IEnumerable1 sleepDurationsEnumerable, Func4 sleepDurationProvider, Boolean continueOnCapturedContext) [16:04:30 ERR] ---------- Exception Data ---------- Redis-Message = HMGET _ElsaDemoApp.Server_AbpPermissionsHash Redis-Timeout = 5000 Redis-OpsSinceLastHeartbeat = 0 Redis-Queue-Awaiting-Write = 0 Redis-Queue-Awaiting-Response = 0 Redis-Active-Writer = False Redis-Backlog-Writer = CheckingForTimeout Redis-Read-State = NotStarted Redis-Write-State = Idle Redis-Inbound-Bytes = 0 Redis-Last-Result-Bytes = 0 Redis-Inbound-Buffer-Bytes = 0 Redis-Sync-Ops = 0 Redis-Async-Ops = 3 Redis-Server-Endpoint = 127.0.0.1:6379 Redis-Server-Connected-Seconds = n/a Redis-Abort-On-Connect = 0 Redis-Multiplexer-Connects = 1/1/0 Redis-Manager = 10 of 10 available Redis-Client-Name = VBI-VDI-00HK(SE.Redis-v2.7.27.49176) Redis-ThreadPool-IO-Completion = (Busy=0,Free=1000,Min=1,Max=1000) Redis-ThreadPool-Workers = (Busy=3,Free=32764,Min=8,Max=32767) Redis-ThreadPool-Items = (Threads=7,QueuedItems=0,CompletedItems=164,Timers=7) Redis-Busy-Workers = 3 Redis-Version = 2.7.27.49176 redis-command = HMGET _ElsaDemoApp.Server_AbpPermissionsHash request-sent-status = WaitingInBacklog redis-server = 127.0.0.1:6379
[16:04:30 ERR] ---------- Exception Data ---------- Redis-Message = HMGET _ElsaDemoApp.Server_AbpFeaturesHash Redis-Timeout = 5000 Redis-OpsSinceLastHeartbeat = 0 Redis-Queue-Awaiting-Write = 1 Redis-Queue-Awaiting-Response = 0 Redis-Active-Writer = False Redis-Backlog-Writer = CheckingForTimeout Redis-Read-State = NotStarted Redis-Write-State = Idle Redis-Inbound-Bytes = 0 Redis-Last-Result-Bytes = 0 Redis-Inbound-Buffer-Bytes = 0 Redis-Sync-Ops = 0 Redis-Async-Ops = 3 Redis-Server-Endpoint = 127.0.0.1:6379 Redis-Server-Connected-Seconds = n/a Redis-Abort-On-Connect = 0 Redis-Multiplexer-Connects = 1/1/0 Redis-Manager = 10 of 10 available Redis-Client-Name = VBI-VDI-00HK(SE.Redis-v2.7.27.49176) Redis-ThreadPool-IO-Completion = (Busy=0,Free=1000,Min=1,Max=1000) Redis-ThreadPool-Workers = (Busy=2,Free=32765,Min=8,Max=32767) Redis-ThreadPool-Items = (Threads=7,QueuedItems=0,CompletedItems=164,Timers=7) Redis-Busy-Workers = 2 Redis-Version = 2.7.27.49176 redis-command = HMGET _ElsaDemoApp.Server_AbpFeaturesHash request-sent-status = WaitingInBacklog redis-server = 127.0.0.1:6379
Service is running checked PM> Get-Service -Name "RabbitMQ"
Status Name DisplayName
Running RabbitMQ RabbitMQ
PM>
I updated all the packages from nuget in downloaded project.
Can you help me with this so that i can run and understand the elsa module working.
I have checked this with swagger i am giving you detail here
Request from swagger https://localhost:44371/api/language-management/language-texts/BookMaster/hi/BookMaster%3A%3ABookPrices?value=%E0%A4%95%E0%A4%BF%E0%A4%A4%E0%A4%BE%E0%A4%AC%20%E0%A4%95%E0%A5%80%20%E0%A4%95%E0%A5%80%E0%A4%AE%E0%A4%A4
Response -- Microsoft.AspNetCore.Routing.Matching.AmbiguousMatchException: The request matched multiple endpoints. Matches:
Volo.Abp.LanguageManagement.LanguageTextController.UpdateAsync (Volo.Abp.LanguageManagement.HttpApi)
Elephant.LanguageTexts.LanguageTextController.UpdateAsync (Elephant)
at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ReportAmbiguity(Span1 candidateState) at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.ProcessFinalCandidates(HttpContext httpContext, Span1 candidateState)
at Microsoft.AspNetCore.Routing.Matching.DefaultEndpointSelector.Select(HttpContext httpContext, Span`1 candidateState)
at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.MatchAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext)
at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<
Accept: / Accept-Encoding: gzip, deflate, br, zstd Accept-Language: en-US,en;q=0.9 Connection: close Content-Length: 0 Cookie: .AspNetCore.Mvc.CookieTempDataProvider=CfDJ8KJd1SFUIWtGszVVfvyHcAM86aAOknmSyS75ugsbS-OQHOHaLTQ-D7Wu2XidOzWKtDjUFBnDwGiGFKKtFXbf6HRbK4D-oeBgGTCjN3Zhv0V-hVYFb5vQd5yr6EvKOlWj4cGV_u7fBvpwQTs9UH_uXqOG0gmoxndoENqSftaC8mz; .AspNetCore.Antiforgery.1I8H_rb8Gbk=CfDJ8KJd1SFUIWtGszVVfvyHcAOq8QX2r7zgWtfILABprWQghfDl0kzmAxVIMbjzoDKEIQPtFFz180D5GL2Q6gVqVHkb4lJi_1kXsnN_Z5U0tmEDhdfc3HrQK4JCzWV5lxFGk0ph4dDrjX60EwSSaWY0QZQ; .AspNetCore.Identity.Application=CfDJ8KJd1SFUIWtGszVVfvyHcAMqVG5Kxpogslq5eiKs9s0uqUnzHNIHuKYEX6R3dQ0oWcQ96HDQn8P6Y2X9BWVgRkc-5xIfZX7y6w43YTJDxoSbq0JsCKdsiHmPqJHdPUDdpz1pxHS90wxxrKk_n353oG8C5X7RmxCywxm145Z0ZjQ2tvbl_qfSsv-gbEwTJyWtVTQX92ZI8jnIWKLtwOWy6ypY2jizgtA3u3RfA8bZ1xtI9rJwh4K71QjrnfQ20KG_GcFgnZ8WdCXQmeleWtZRsauwPsQiDJHjpxHl-KNlzDKGWw1Fvlmrxlr7uVUVZ7Pru7ELv-7TV8wtP-PlZPpJ9TDdQqknQF__mNCk4A-B_QnV6GDVI8j4tmPL1OOZSLgQLpjv601x-2SFJSRHeJCwoaZccoG1oV5Stuun85vSFJdyP2BjB_6tFQZGbOmUtdrkdY6weQByyxBCatg2olM90HRXH501dFrPuNk3ukiuJ8IjisXLxPuQFq7dy9sxhFK7xAIi-m_5mmxuX4Mv3cAT74VJJBNpoPn8Yc4Gj9YRJtFZDxCQt4j8aRPkFh78tZWFjpqhSagg2DXV0WQA5EAOJ347cfYQVHP0DkPvIPrxOb7J561fzbXv9qVWwBcSi5L__B8ePIR2h8cgqzOueTy5RPydgCZ6K5LS4mSlrxbvyLNdHXhUxGYaUPQcsNRX95FEWa_uvOk1WE02lqLqqcNC1Z2KOhQQ3dH9lOygJDdbTpXbz9YRITHNXZXaccaLm1vLUsRP7nX_2E3lP3c7JqdTQUdh7bonbnkcLhkB84bppx9T8r8C4fcBRbF_gU30S8DldAvOtPfQQKH-p74nIyx3JRHSr2LyFbfphP4uhey8pKyt4qLy7DFwPeUXvZlEMjUBrPjr_dYCplB-C4c1f5JnQuVV4w1RvEAOnvdNCtPlZvj; XSRF-TOKEN=CfDJ8KJd1SFUIWtGszVVfvyHcAMHXZo8P6c3EkUEGL8L-x5Ak1-eW-35Nkyvh64cM06uhk-pt7V27ss5h0ZJQ5OAQ-oXWxNRASebHtNVsGQ3--1EsToSuuuU63QYCbwH66o9xPy-iFWkVkYKnd-bDEA9jZ6tEEpAjI36kaAw21clumhO1JAGwguRkv5VEHokS7ua3g Host: localhost:44371 Referer: https://localhost:44371/swagger/index.html User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0 requestverificationtoken: CfDJ8KJd1SFUIWtGszVVfvyHcAMHXZo8P6c3EkUEGL8L-x5Ak1-eW-35Nkyvh64cM06uhk-pt7V27ss5h0ZJQ5OAQ-oXWxNRASebHtNVsGQ3--1EsToSuuuU63QYCbwH66o9xPy-iFWkVkYKnd-bDEA9jZ6tEEpAjI36kaAw21clumhO1JAGwguRkv5VEHokS7ua3g sec-ch-ua-platform: "Windows" x-requested-with: XMLHttpRequest sec-ch-ua: "Not;A=Brand";v="8", "Chromium";v="150", "Microsoft Edge";v="150" sec-ch-ua-mobile: ?0 origin: https://localhost:44371 sec-fetch-site: same-origin sec-fetch-mode: cors sec-fetch-dest: empty priority: u=1, i X-Correlation-Id: 00ff3e7f9deb4abaaf22519e667e3a1c
With help of below ticket we have implemented the extended code to attach file with chat Our Support Ticket
We have used controller `using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.BlobStoring;
namespace Elephant.ChatAttachment;
///
private static readonly HashSet<string> AllowedMimeTypes = new(StringComparer.OrdinalIgnoreCase)
{
// Images
"image/jpeg", "image/png", "image/gif", "image/webp", "image/bmp", "image/svg+xml",
// Documents
"application/pdf",
"application/msword",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-excel",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
// Archives & generic
"application/zip",
"application/x-zip-compressed",
"text/plain",
"text/csv",
};
private readonly IBlobContainer<ChatAttachmentContainer> _blobContainer;
public ChatAttachmentController(IBlobContainer<ChatAttachmentContainer> blobContainer)
{
_blobContainer = blobContainer;
}
/// <summary>
/// Accepts a single file via multipart/form-data, stores it in the
/// chat-attachment blob container, and returns the blob metadata.
/// </summary>
[HttpPost("upload")]
[Consumes("multipart/form-data")]
[RequestSizeLimit(MaxFileSizeBytes + 4096)] // small extra for form overhead
[ApiExplorerSettings(IgnoreApi = true)] // Swashbuckle 10.x cannot introspect IFormFile; injected via ChatAttachmentDocumentFilter
public async Task<ChatAttachmentDto> UploadAsync([FromForm] IFormFile file)
{
if (file == null || file.Length == 0)
{
throw new Volo.Abp.UserFriendlyException("No file was uploaded.");
}
if (file.Length > MaxFileSizeBytes)
{
throw new Volo.Abp.UserFriendlyException(
$"File size {file.Length / (1024 * 1024):F1} MB exceeds the 20 MB limit.");
}
var mimeType = file.ContentType?.ToLowerInvariant() ?? "application/octet-stream";
if (!AllowedMimeTypes.Contains(mimeType))
{
throw new Volo.Abp.UserFriendlyException(
$"File type '{mimeType}' is not allowed.");
}
var blobId = Guid.NewGuid().ToString("N");
await using var stream = file.OpenReadStream();
await _blobContainer.SaveAsync(blobId, stream, overrideExisting: false);
return new ChatAttachmentDto
{
BlobId = blobId,
FileName = file.FileName,
MimeType = mimeType,
Size = file.Length,
};
}
/// <summary>
/// Streams an uploaded attachment back to the caller.
/// The blob ID acts as an opaque capability token — any authenticated user
/// who possesses the ID may download the file.
/// </summary>
[HttpGet("{blobId}")]
public async Task<IActionResult> DownloadAsync(string blobId)
{
if (string.IsNullOrWhiteSpace(blobId))
{
return BadRequest();
}
var stream = await _blobContainer.GetOrNullAsync(blobId);
if (stream == null)
{
return NotFound();
}
// We do not persist the original MIME or filename on the server,
// so we serve as octet-stream. Clients that know the MIME from the
// attachment token can render appropriately without relying on this header.
return File(stream, "application/octet-stream");
}
} `
Now we are using these api's in react.js UI .We are storing data in sql table using blob container.
All the delete request completes successfully Only after the delete request completes , i try to reupload the same file then i get the concurrency error.
I'm encountering an issue when calling the Language Text Update API: PUT /api/language-management/language-texts/{resourceName}/{cultureName}/{name} The request fails with a 500 Internal Server Error, and the browser reports it as a CORS issue. Request URL: https://localhost:44371/api/language-management/language-texts/AbpAccount/de-DE/AccessDenied?value=Zugriff+abgelehnt! Browser Error: Access to XMLHttpRequest at 'https://localhost:44371/api/language-management/language-texts/AbpAccount/de-DE/AccessDenied?value=Zugriff+abgelehnt!' from origin 'http://localhost:44347' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Failed to load resource: net::ERR_FAILED
The chat module currently does not provide a SignalR event for message deletion. Issue when upload attachments on the chat module: Endpoint: https://localhost:44371/api/app/chat-attachment/upload Payload: file (binary) Error Response: { "error": { "code": null, "message": "The data you have submitted has already been changed by another user. Discard your changes and try again.", "details": null, "data": null, "validationErrors": null } } When I delete multiple uploaded images and immediately try to upload the same images again at the same time, the API returns the error shown above. However, if I delete the images and then re-upload them one by one, the upload works correctly without any errors.
In our project we have implemented abp language module
We currently have an API to update existing language texts (/api/language-management/language-texts/{resourceName}/{cultureName}/{name}),
but there is no API available to create new language texts. can you please let me know how can we create new Language text from UI using the api.
Thanks for your help i am able to do this now,
can you please explain this section Then point the container to it:
[BlobContainerName("CompanyDocument")] public class CompanyDocumentContainer { }
Configure<AbpBlobStoringOptions>(options => { options.Containers.Configure<CompanyDocumentContainer>(container => { container.ProviderType = typeof(CompanyDocumentBlobProvider); }); });