Note that there are some explanatory texts on larger screens.

plurals
  1. PODownloading files from the server
    primarykey
    data
    text
    <p>Currently I have stored on a BD files of any type in binary format. The process I do in the file upload is as follows:</p> <ol> <li>Drag &amp; Drop files and collects is sent to the server. </li> <li>In the server collects the stream of each file.</li> <li>Each stream is converted to byte ()</li> <li>It almancena the Byte () in BD Correctly</li> </ol> <p>Now, it's time to download the files, which consists of obtaining the data from the database in Byte (), and downloaded directly from the customer.</p> <p>The problem is that I am using methods not throw any download window and I'm not making that mistake. Deputy code for possible help.</p> <pre><code>Protected Sub grdDocumentoByExp_RowCommand(sender As Object, e As GridViewCommandEventArgs) If e.CommandName = "cmdDownload" Then Dim context As System.Web.HttpContext = System.Web.HttpContext.Current Dim lFileName As String = e.CommandName Dim lFile() As Byte = GetImageArrayBy_docID(e.CommandArgument) Dim ms As Stream = New MemoryStream(lFile, 0, lFile.Length) ms.Position = 0 ms.Close() With context .Response.Clear() .Response.ClearHeaders() .Response.ClearContent() .Response.ContentType = "image/jpeg" .Response.AddHeader("content-disposition", "attachment;filename=" &amp; "Fichero1.jpg") .Response.AddHeader("content-length", lFile.Length) .Response.BinaryWrite(lFile) .Response.End() End With End If End Sub </code></pre> <p><strong>The idea is as follows</strong>: A grid has a column that runs <strong>a command, run this code block</strong>. In it, <strong>collects the byte () from the database (which appears to be correct in content), is transmitted to a Stream</strong> and sent through the current context as <strong>BinaryWrite</strong>, but never run anything in the browser .</p> <p>The client used is Firefox and Chrome, but none of them anything happens. Indicate that I am going as we see, the <strong>MIME</strong> file, which in this case is jpeg, although there are many other types.</p> <p>Can anyone know what is happening or I can be doing wrong?</p> <p>Thank you very much.tiendo. Attach code for possible help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload