Upload - use unicode (utf-8) character set for request/response data

ActiveX/VBSScript registry editor  ActiveX NT User account manager  Export MDB/DBF from ASP
Url replacer, IIS url rewrite Active LogFile  Email export  ActiveX/ASP Scripting Dictionary object
 IISTracer, real-time IIS monitor
 Huge ASP upload - upload files with progress.
          Sample for ScriptUtils.ASPForm.CharSet 

Examples

Upload - use unicode (utf-8) character set for request/response data 
<%
'Sample file Unicode.asp
'Use unicode (utf-8) character set for request/response data.
  
  Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
  
  Response.CharSet = "utf-8"

  If Form.State = 0 Then 
    'Set conversion character set.
    Form.CharSet = Response.CharSet
    '

    Dim DestFolder: DestFolder = Server.MapPath("UploadFolder")
    
    'Saev source files
    Form.Files.Save DestFolder

    For Each Item In Form
      I = I + 1
      Response.Write "<br><br>Item no.:" & I
      Response.Write "<br>Length:" & Item.Length

      'Write unicode name of the source field.
      WriteUTF8Data "<br>Name:" & Item.Name
      If Item.IsFile Then
        'Write unicode value of the source file name.
        WriteUTF8Data "<br>File path:" & Item.FilePath

        'Write source UTF-8 representation (encoded) of the same value
        WriteUTF8Data "<br>Source path, encoded by UTF-8:" & Item.FilePath("x-ansi")
      Else' Item.IsFile then
        'Write contents for non-file fields.

        'Write unicode value of the source field.
        WriteUTF8Data "<br>Value:" & Item.String

        'Write source representation of the same value
        WriteUTF8Data "<br>Source value, encoded by UTF-8:" & Item.String("x-ansi")
      End If' Item.IsFile then

    Next
    Response.End
  End If

  'Create HTML output in ANSI code page
  Dim HTML
  HTML = "This form demonstrates use of unicode (utf-8) character set for text fields and file names<br>"
  HTML = HTML & "Try to write text / select filename with characters not in U.S. ASCII character subset.<br>"
  HTML = HTML & "<form name=file_upload method=POST ENCTYPE=multipart/form-data>"
  HTML = HTML & "<input Name=Description1 Size=50 Value=""Some non-U.S. ASCII chars - ìšèøžýáíéÌŠÈØŽ""><br>"
  HTML = HTML & "<input Name=File1 Type=File><br>"
  HTML = HTML & "<input Value=Submit >> Type=Submit><br>"
  HTML = HTML & "</Form>"


WriteUTF8Data HTML

'Write utf-8 data using Session.CodePage
Sub WriteUTF8Data1(HTML)  

  Session.CodePage = 65001
  Response.Write HTML
End Sub

'Write utf-8 data using ScriptUtils.ByteArray, without session object.
Sub WriteUTF8Data(HTML)  

  Dim ByteArray
  Set ByteArray = CreateObject("ScriptUtils.ByteArray") 

  'set ByteArray charset to UTF-8 (code page 65001)
  ByteArray.CharSet = "utf-8"

  'Write HTML data to byte array
  ByteArray.String = HTML

  'Write binary data to output.
  Response.BinaryWrite ByteArray.ByteArray
End Sub
  
%>
  Other links for Upload - use unicode (utf-8) character set for request/response data

ScriptUtils.ASPForm

The ASPForm collection retrieves the values of form elements posted to ASP script by a form using the POST method. ASPForm can process multipart/form-data or application/x-www-form-urlencoded data with length up to 2GB.

ScriptUtils

     Huge ASP upload is easy to use, hi-performance ASP file upload component with progress bar indicator. This component lets you upload multiple files with size up to 2GB to a disk or a database along with another form fields. Huge ASP file upload is a most featured upload component on a market with competitive price and a great performance.

     The software has also a free version of asp upload with progress, called Pure asp upload, written in plain VBS, without components (so you do not need to install anything on server).

     This installation package contains also ScriptUtilities library. Script Utilities lets you create hi-performance log files, works with binary data, you can download multiple files with zip/arj compression, work with INI files and much more with the ASP utility.


© 1996 – 2008 Antonin Foller, Motobit Software, help{at}pstruh.cz, help v. 2.20.24