Click here to Skip to main content
15,881,172 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Hardly any .onnx modules. But plenty of .pt Modules included. Pin
Richard MacCutchan9-May-23 22:25
mveRichard MacCutchan9-May-23 22:25 
GeneralRe: Hardly any .onnx modules. But plenty of .pt Modules included. Pin
Member 1594023810-May-23 2:43
Member 1594023810-May-23 2:43 
QuestionQuestion about Dependency Injection Pin
Fred283428-Apr-23 2:28
Fred283428-Apr-23 2:28 
AnswerRe: Question about Dependency Injection Pin
Gerry Schmitz28-Apr-23 4:39
mveGerry Schmitz28-Apr-23 4:39 
AnswerRe: Question about Dependency Injection Pin
jschell28-Apr-23 11:21
jschell28-Apr-23 11:21 
AnswerRe: Question about Dependency Injection Pin
Bohdan Stupak29-Apr-23 3:43
professionalBohdan Stupak29-Apr-23 3:43 
AnswerRe: Question about Dependency Injection Pin
Rob Philpott18-Jul-23 4:18
Rob Philpott18-Jul-23 4:18 
QuestionExe File encoding - http via vb.net Pin
Bart van Tuijl31-Mar-23 21:20
Bart van Tuijl31-Mar-23 21:20 
I'm in the process of building a HTML server using vb.net which dose the job quite well. Currently I'm trying to add a function for downloading files. The sending of plain text works without a glitch (see code 1). However sending files such as executables (*.exe) or Excel (*.xls) files dosen't work (see code 2).

The file once downloaded simply wont run. Upon closer examination (by opening the downloaded file in Notepad) signs of incorrect encoding are typically seen. there are a lot of question mark characters and when compared 1 on 1 with the original file it is clear that the encoding is the problem. Simply said I have no idea on how to resolve this and internet research isn't proving to be a reliable bron of information. Since the problem is one of encoding what I have tried is to read the exe file through a file stream-read and convert its context (probably binary) to text and send that with result that there there is an inprovment but the problem still persists and ultimatlhy the file still dosen't work.

How do I resolve this?

CODE 1

With My404HtmlPage

                        .Append("HTTP/1.1 200 OK" & Environment.NewLine)
                        .Append("Content-Type:  text/plain & Environment.NewLine)
                        .Append("Content-Disposition: attachment; filename=" & Chr(34) & "Download.exe" & Chr(34) & Environment.NewLine)
                        .Append(Environment.NewLine)

                        .Append("Hello World!")

                    End With


CODE 2

With My404HtmlPage

                        .Append("HTTP/1.1 200 OK" & Environment.NewLine)
                        .Append("Content-Type:  application/octet-stream & Environment.NewLine)
                        .Append("Content-Disposition: attachment; filename=" & Chr(34) & "Download.exe" & Chr(34) & Environment.NewLine)
                        .Append(Environment.NewLine)

                        Dim bytes = My.Computer.FileSystem.ReadAllBytes("C:\Original.exe")
                        Dim MyString As String = Encoding.UTF8.GetString(bytes)

                       .Append("content-bytes:" & MyString)
End With

AnswerRe: Exe File encoding - http via vb.net Pin
Dave Kreskowiak1-Apr-23 5:18
mveDave Kreskowiak1-Apr-23 5:18 
AnswerRe: Exe File encoding - http via vb.net Pin
Richard MacCutchan1-Apr-23 5:42
mveRichard MacCutchan1-Apr-23 5:42 
AnswerRe: Exe File encoding - http via vb.net Pin
Eddy Vluggen1-Apr-23 6:28
professionalEddy Vluggen1-Apr-23 6:28 
GeneralRe: Exe File encoding - http via vb.net Pin
Bart van Tuijl2-Apr-23 5:13
Bart van Tuijl2-Apr-23 5:13 
GeneralRe: Exe File encoding - http via vb.net Pin
Richard Deeming2-Apr-23 22:05
mveRichard Deeming2-Apr-23 22:05 
GeneralRe: Exe File encoding - http via vb.net Pin
Bart van Tuijl3-Apr-23 5:49
Bart van Tuijl3-Apr-23 5:49 
GeneralRe: Exe File encoding - http via vb.net Pin
Richard MacCutchan3-Apr-23 6:13
mveRichard MacCutchan3-Apr-23 6:13 
GeneralRe: Exe File encoding - http via vb.net Pin
Richard Deeming3-Apr-23 6:44
mveRichard Deeming3-Apr-23 6:44 
GeneralRe: Exe File encoding - http via vb.net Pin
Bart van Tuijl3-Apr-23 7:33
Bart van Tuijl3-Apr-23 7:33 
GeneralRe: Exe File encoding - http via vb.net Pin
jschell4-Apr-23 6:19
jschell4-Apr-23 6:19 
AnswerRe: Exe File encoding - http via vb.net Pin
jschell3-Apr-23 6:09
jschell3-Apr-23 6:09 
QuestionBad Programming??... Pin
FreakNeck71631-Mar-23 4:09
FreakNeck71631-Mar-23 4:09 
AnswerRe: Bad Programming??... Pin
Richard Deeming31-Mar-23 4:59
mveRichard Deeming31-Mar-23 4:59 
AnswerRe: Bad Programming??... Pin
Gerry Schmitz31-Mar-23 6:49
mveGerry Schmitz31-Mar-23 6:49 
AnswerRe: Bad Programming??... Pin
Dave Kreskowiak31-Mar-23 12:08
mveDave Kreskowiak31-Mar-23 12:08 
AnswerRe: Bad Programming??... Pin
jschell3-Apr-23 6:42
jschell3-Apr-23 6:42 
AnswerRe: Bad Programming??... Pin
Valley Kid31-Aug-23 19:37
Valley Kid31-Aug-23 19:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.