Eistee
Explore posts from serversImage upload and hosting
How do you host images securely?
The images would only be uploaded by admins and displayed to users.
The upload should take place via the ASP.NET Core App, but where to? How do you do that?
The app is small and would have a few hundred users.
So far I have only published internally on the intranet.
This time the project should be accessible from the Internet 😨 and I don't know how to make the image upload possible and secure.
7 replies
✅ Dealing/resolving nullable warnings
I try to deal with nullable warnings among others e. g. CS8604 "Possible null reference argument for parameter."
I have the following sample code of a C# 7.0 worker service:
Is that so well solved that you always check for is not null?
10 replies
❔ Razor Pages Session for revalidating Page Model
Can someone help me to configure the Session for Razor Pages, that I can use
TryValidateModel()
?
is throwing a InvalidOperationException: Session has not been configured for this application or request.
error?
I can't find any hint about the online
https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.razorpages.pagemodel.tryvalidatemodel?view=aspnetcore-7.0
The debugger is actually stepping over it, but the trace says:
The server side page Post method looks like this:
2 replies
✅ When and how should I use the Windows EventLog?
Hello, do I need to create proper source via
EventLog.CreateEventSource
?
If I need to, what is the proper way to create this source if the application has no setup and should run without elevated rights?
I could imagine to add another executable, which only registers the source, that you can get those from the actual program with System.Diagnostics.Process.Start
and startInfo.Verb = "runas";
Do you have an opinion on this or can you give me some tips?5 replies
❔ Handling of objects which correspond to a given rule by editing again.
The situation:
The user can create objects in a list via the UI. If there are already one or more objects in this list and they have the same properties name and color, all these objects are invalid.
The creation of the object should not be interrupted, there is only a warning at time of creation.
I would check this logic with the warning and setting the invalidity when creating the object.
The question now is, how is it design wise good to make these objects valid again by editing each one?
Should this also be done only by editing the individual objects? If there is more than 1 duplicate with these two properties, only the currently edited object should be made valid again. If there is only one duplicate, the other object must also be found in the list and validated. I am having trouble implementing this logic 😓
3 replies