Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a VB example of an ashx file for pluploader.</p> <p>Thanks to @@Darin Dimitrov Who suggested this. Its the best solution ever with many fall backs like silverlight,flash.. etc.. its mega!</p> <p>I did not find any VB examples so i converted it my self- tested and works! With chunking!</p> <p>To add a ashx file to your website in VisualStudio. Right click the website </p> <p><strong>website > add new item > generic handler</strong> </p> <p>This is all in one page no need for code behind. Just call this from the pluplaod plugin</p> <pre><code>&lt;%@ WebHandler Language="VB" Class="upload" %&gt; Imports System Imports System.IO Imports System.Web Public Class upload : Implements IHttpHandler Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim chunk As Integer = If(context.Request("chunk") IsNot Nothing, Integer.Parse(context.Request("chunk")), 0) Dim fileName As String = If(context.Request("name") IsNot Nothing, context.Request("name"), String.Empty) Dim fileUpload As HttpPostedFile = context.Request.Files(0) Dim uploadPath = context.Server.MapPath("~/uploads") Using fs = New FileStream(Path.Combine(uploadPath, fileName), If(chunk = 0, FileMode.Create, FileMode.Append)) Dim buffer = New Byte(fileUpload.InputStream.Length - 1) {} fileUpload.InputStream.Read(buffer, 0, buffer.Length) fs.Write(buffer, 0, buffer.Length) End Using context.Response.ContentType = "text/plain" context.Response.Write("Success") End Sub Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class </code></pre>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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