Read

          Method 
          Member of  ScriptUtils.ASPForm 

Description
Reads source form data from the client using Request.BinaryRead
You can use this method to cause ASPForm read source data in special error cases, especially when fsSizeLimit error occurs. You can read part of source data with first n fields
Syntax
ASPForm.Read ([NumberOfBytesToRead as Long = -1 = SizeLimit], [NumberOfFieldsToRead as Long = -1 = All source fields])
 
Where Type Optional Default Description
 NumberOfBytesToRead  Long  yes  -1 = SizeLimit  Maximum number of bytes to read 
 NumberOfFieldsToRead  Long  yes  -1 = All source fields  Maximum number of source form fields to read 
Remarks
You do not need to call this method explicitly.
This method is called by default when next Form method/property is called:
ScriptUtils.ASPForm.Items
ScriptUtils.ASPForm.Files
ScriptUtils.ASPForm.Texts
ScriptUtils.ASPForm.SourceData
ScriptUtils.ASPForm.State
_NewEnum (For Each ... in Form)
Examples
 Upload - cause read when source data exceeds a limit  
<%
'Stores only files with size less than MaxFileSize


Dim DestinationPath
DestinationPath = Server.MapPath("UploadFolder")

'Create a form object
Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")

'Set script timeout and maximum form limit
Server.ScriptTimeout = 2000
Form.SizeLimit = &H100000 '1MB


If Form.State = 0 Then 'Completted
  'process source data
  Form.Files.Save DestinationPath 
  Response.Write "<br><Font Color=green>Files (" & Form.TotalBytes \1024 _
   & "kB) was saved to " & DestinationPath & " folder.</Font>"
ElseIf Form.State > 10 Then
  'Check error states
  Const fsSizeLimit = &HD
  
  Select Case Form.State
    Case fsSizeLimit:
      'check some fields if source data exceeds limit 

      'Cause read at least 3 source fields, maximum of 100kB
      'ASPForm will read text1, check1 and hidden1 fields
      Form.Read 100000,3
      If Form.State <10 Then
        'Source fields was read.
        Response.Write "<br>Number of read source form fields: " & _
          Form.Fields.Count
        Response.Write "<br>Number of read source bytes: " & _
          Form.BytesRead
        Response.Write "<br>Text1 value: " & _
          Form("Text1")
        Response.Write "<br>Hidden1 value: " & _
          Form("Hidden1")
      End If

      Response.Write  "<br><Font Color=red>Source form size (" & _
        Form.TotalBytes & "B) exceeds form limit (" & _
        Form.SizeLimit & "B)</Font><br>"

      'Why MS means that 'friendly' error messages are friendly???
      Response.Write Space(5555)
    Case Else Response.Write "<br><Font Color=red>Some form error.</Font><br>"
  End Select
End If'Form.State = 0 then


%>  
<!DOCTYPE HTML Public "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
 <TITLE>ASP huge file upload, cause read In 
 a special Case - source data exceeds a limit.</TITLE>
</HEAD>
<BODY BGColor=white>


<Div style=width:600>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  
  <TR>
    <TH noWrap align=Left width="20%" bgColor=khaki> <A 
      href="https://www.motobit.com/help/scptutl/upload.asp">Power ASP 
      file upload</A>, cause read In a special Case - 
      source data exceeds a limit. </TH>
    <TD> </TD></TR></TABLE>
<TABLE cellSpacing=2 cellPadding=1 width="100%" bgColor=white border=0>
  
  <TR>
    <TD colSpan=2>
      <P>      This sample demonstrates reading 
      part of a source data (text, hidden And checkbox fields) 
      when source data size exceeds a form limit.<br>

            You can cause form To read 
      specified number of source fields with maximum size, Or specified number 
      of source bytes. You can Loop through source fields collection, 
      work with fields And read field values as with standard form Then.

  <br>Upload timeout Is <%=Server.ScriptTimeout%>s
  <br>Form size limit Is <%=Form.SizeLimit \ 1024 %>kB
  <br>Destination folder Is <%=DestinationPath%>


      </P>
  </TD></TR></TABLE>





<form method="POST" ENCTYPE="multipart/form-data">

   Text : <input name="Text1" value="Some text value 1"><br>
   Check1 : <input name="Check1" value="1" Type=CheckBox>Some checkbox<br>
   Hidden : <input type="hidden" name="Hidden1" value="Some hidden value"><br>
   File 1 : <input type="file" name="File1"><br>
   File 2 : <input type="file" name="File2"><br>
   File 3 : <input type="file" name="File3">
<br>           
<input Name=SubmitButton Value="Upload files >>" Type=submit><br>

</Form>


<HR COLOR=silver Size=1>
<CENTER>
<FONT SIZE=1>© 1996 – <%=Year(Date)%> Antonin Foller, <a 
  href="http://www.motobit.com">PSTRUH Software</a>, e-mail <A 
  href="mailto:help@pstruh.cz" >help@pstruh.cz</A>
<br>To monitor current running uploads/downloads, see <A 
  Href="https://www.motobit.com/help/iistrace/iis-monitor.asp">IISTracer 
  - IIS real-Time monitor</A>.
</FONT>

</CENTER>
</Div>
</BODY></HTML>
 POST, ASPForm - Work with original posted data.  
  Other links for Read
Methods of ASPForm class
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.
      Easy to use, hi-performance ASP file upload component with progress bar indicator. Let's you upload multiple files with size up to 2GB to a disk or database along with another form fields. Works with large posts, any character set (including unicode utf-8). Contains one-click multiple files/folders download with on-the-fly compression (Using BinaryWrite/BinaryRead).
      Hi-performance text file logging for ASP/VBScript/VBA applications. Lets you create daily/weekly/monthly log files with variable number of logged values and extra timing and performance info.
       Lets you work with safearray binary data in VBS/JS. It also enables conversion between binary and String data using several code pages. ZLib compress and uncompress functions. Lets you transfer files using compressed stream from a client to server using IE.
      This library also enables calling of some Kernel and Advapi functions (performance, timing, sleep, configuration ...) and enables native work with INI files.


© 1996 – 2005 Motobit Software, help{at}pstruh.cz, help v. 2.16.14