Archived Forum Post

Index of archived forum posts


UploadRcv not seeing files

Oct 09 '14 at 05:30

Hi, I've just setup a new server with the latest chilkatupload.dll. For some reason the server isn't seeing the files or form values being posted. Everything looks fine from a code point of view... any ideas?

alt text


alt textFound the answer for this. In IIS7, you need to change the ASP / maxRequestEntityAllowed setting to > 200KB if you want to upload files larger than that. Otherwise the uploadrcv object returns a null POST.


I tested with v9.4.1, and also with Chilkat's latest internal pre-release:


and in both cases, everything worked fine.

To ensure the HTTP request (i.e. the multipart/form-data) is a correct and valid one, send it with a browser via a simple HTML form such as this:

<form method="POST" enctype="multipart/form-data" action = "" >
<input name=hid1 type=hidden value="test123">
<input name=hid2 type=hidden value="abcdef">
<input name=attach1 type=file size=20>
<input type=submit value="Upload">

My receiving ASP script looks like this:

<% @CodePage = 65001 %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
'  The Chilkat ASP Upload component is freeware.
'  The UploadRcv object receives uploads in ASP.
'  It can be used to save uploaded files to the web server,
'  or to save directly to memory for immediate access.
set receiver = Server.CreateObject("Chilkat.UploadRcv")

'  Stream uploads to a directory:
'receiver.SaveToUploadDir = 1
receiver.UploadDir = Server.MapPath("receivedData")

'  Don't allow anything over 1MB
receiver.SizeLimitKB = 1000

'  Set a timeout just in case something hangs
'  This is a 20-second timeout:
receiver.IdleTimeoutMs = 20000

'  Consume the upload.  Files are streamed to the UploadDir
success = receiver.Consume()
    Response.Write receiver.LastErrorHtml

If (success = 0) Then
    Response.Write receiver.LastErrorHtml
    '  Display the files received:
    Response.Write "<p>Num file received: " & receiver.NumFilesReceived & "</p>"
    If (receiver.NumFilesReceived > 0) Then
        For i = 0 To receiver.NumFilesReceived - 1
            Response.Write "<p>Received " &  receiver.GetFilename(i) &  " (" & receiver.GetFileSize(i) & " bytes)</p>"
    End If

Response.Write "<p>Success.</p>"
End If