« first day (164 days earlier)      last day (1174 days later) » 

4:44 AM
@RudiVisser but how browser will just display pdf or doc based on path?
In this case then what should be return type froom webapi controller?
 
 
3 hours later…
7:17 AM
Morning all
@Learning-Overthinker-Confused The decision is what you store in your database. In all cases, quite obviously, you return the file content to the user's browser
 
I am just storing Filename in the database i.e just guid
then i do wildcard search in my directory
 
Right, so then load the file's contents and return that to the browser
 
Content-Disposition: inline; filename=8073b338-73ce-4c5f-b28a-3e347df21ace.pdf
Content-Type: application/octet-stream
but it is not viewing the file
it is always downloading the file
i mean browser
 
7:38 AM
Have you tried setting the content type to be the correct content type?
 
yes so when i set application/pdf then it view the file
but i want some generic because i have pdf,doc,image too
 
If you make it application/octet-stream the browser doesn't know what to do. You can detect the content type using MimeMapping.GetMimeMapping(..)
 
but i guess application/octetstream is generic right and cant we not instruct browser to view file based on any property like inline?
 
No. application/octet-stream is telling the browser you're sticking a load of bytes in its face, the browser isn't going to do your job for you.
 
This MimeMapping.GetMimeMapping(..) doesnt works in .net core
 
7:59 AM
You're right. In Core you can use the MimeMapping NuGet package
 
Go for it
 
Yes after setting proper content type now i am able to view file
So octetstream is always for downloading file?
 
octet-stream is saying "I don't know what type this is"
So yes, the browser doesn't know what to do with it, which usually results in it downloading the file
 
but everywhere when i search for file download then i see this in code
30
Q: Writing MemoryStream to Response Object

AliI am using the following code to stream pptx which is in a MemoryStream object but when I open it I get Repair message in PowerPoint, what is the correct way of writing MemoryStream to Response Object? HttpResponse response = HttpContext.Current.Response; response.Clear(); response.AppendHeader(...

 
8:12 AM
Yes, attachment also does it
 
All right
Thank you so much sir
sir but whats the reason like what if i include filename isntead of guid ?
Here in case of guid i need to do wild card search
Do you think my approach is good>
?
 
I don't know why you're storing a GUID nor doing a wildcard search. You should store the full path to the uploaded file
 
 
1 hour later…
9:16 AM
Hi how to call the different controller method from the partial view ?
in razor view
 
You can use @Html.Action(..) to call another action in your controller
 
 
1 hour later…
10:47 AM
Hi all
 
Morning Alex!
 
Hi Rudi
 
Good weekend?
 
It was okay. Tried to rest yesterday
How about you?
Just shared this on the wpf room: thoughtworks.com/radar/platforms/net-core
TL;DR... Our teams have confirmed that .NET Core has reached a level of maturity that makes it the default for .NET server applications. The open source .NET Core framework enables the development and deployment of .NET applications on Windows, macOS and Linux with first-class cross-platform tooling.
...Microsoft provides blessed Docker images which make it easy to deploy .NET Core applications in a containerized environment. Positive directions in the community and feedback from our projects indicate that .NET Core is the future for .NET development.
 
Weekend was good!
 
11:32 AM
Trying to make sense of this warranty change: asus.com/us/support/Article/925
Does that mean we can open the machine and update components w/out breaking the warranty now?
 
11:44 AM
Seems that way yeah, unless you break stuff
But I bet if something does break they'll find a way to blame it on your unauth'd repair :)
 
Yup, exactly!
Was reading how SD card readers are way slower than SSD's
 
Well yea?
 
Kinda the same tech but not
 
Had thought about using an internal one as additional storage
Not a good idea
 
11:49 AM
Even the fasted SD is 300MB/s or something? Not quite the 3000MB/s you get from an SSD
 
Woof. Big diff
 
 
1 hour later…
1:15 PM
hi
 
Hey Ronald!
How you doing?
 
am dead
tired AF
 
1:32 PM
That doesn't sound good
 
weekend helping at militracks, really busy]
 
Rudi, you're upside down.
 
he turned around
 
ctrl+alt+down arrow. All better now.
 
 
2 hours later…
3:38 PM
I need to get the chatbot running in slack/twitch again. If I were to add SO functionality what would people want to see?
 
gifs
 
3:50 PM
Hrm. I'm not sure how I'd pass rich media over to SO. I suppose that upload hook is exposed-ish
 
Just get the URL
 

« first day (164 days earlier)      last day (1174 days later) »