Uploads limitations?

hafa

Perch
I've been trying to get a pdf upload capability through http working for one site I'm designing. I've tried aspupload and aspsmartupload, and both have issues with files larger than 500k or so. aspsmartupload returns a browser error "document contains no data" while aspUpload returns a script timeout error. I've set Server.ScriptTimeout = 60, but it still times out.

Please note that both scripts work OK for files < 500km but the client would like to be able to use an online utility to upload pdfs of around 3-8mb; any help getting this going would be appreciated. I've put my code below:

ASPUPLOAD:

<%
Server.ScriptTimeout = 60
Set Upload = Server.CreateObject("Persits.Upload")

' we use memory uploads, so we must limit file size
Upload.SetMaxSize 10000000, True

' Save to memory. Path parameter is omitted
Upload.Save

' Access subdirectory specified by user
subdir = Upload.Form("\docs")

' Build path string
Path = Server.MapPath("\docs")

' Create path, ignore "already exists" error
Upload.CreateDirectory Path, True

' Save files to it. Our form has only one file item
' but this code is generic.
For Each File in Upload.Files
File.SaveAs Server.MapPath("\docs\" & Request.QueryString("docID") & ".pdf")
Response.Write "File saved as " & File.Path & "<BR>"
Next
%>

SMART ASPUPLOAD:

<%
' Variables
' *********
Dim mySmartUpload
Dim file
Dim intCount
intCount=0

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Upload
' ******
mySmartUpload.Upload

' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Save the files with his original names in a virtual path of the web server
' **************************************************************************
file.SaveAs(Server.MapPath("\docs\" & Request.QueryString("docID") & ".pdf")
' sample with a physical path
' file.SaveAs("c:\temp\" & file.FileName)

' Display the properties of the current file
' ******************************************
Response.Write("Name = " & file.Name & "<BR>")
Response.Write("Size = " & file.Size & "<BR>")
Response.Write("FileName = " & file.FileName & "<BR>")
Response.Write("FileExt = " & file.FileExt & "<BR>")
Response.Write("FilePathName = " & file.FilePathName & "<BR>")
Response.Write("ContentType = " & file.ContentType & "<BR>")
Response.Write("ContentDisp = " & file.ContentDisp & "<BR>")
Response.Write("TypeMIME = " & file.TypeMIME & "<BR>")
Response.Write("SubTypeMIME = " & file.SubTypeMIME & "<BR>")
intCount = intCount + 1
End If
Next

' Display the number of files which could be uploaded
' ***************************************************
Response.Write("<BR>" & mySmartUpload.Files.Count & " files could be uploaded.<BR>")

' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.<BR>")
%>
 
Upload limitations are built into Windows Server 2003 I believe. It is a server-level setting aimed at preventing flood attacks. The default limit is usually around 300-500k But if you change the site over to a Windows 2000 server, which doesn't have that limitation built in, the problem will probably disappear.
 
Actually it is 200k,but I typically move up to 20MB, what server is this?

Windows 2000 is outdated now, MS is no longer supporting it, and we do not move customers to windows 2000 servers any longer.
 
Thanks for the reply, Stephen.

I actually worked around the problem by writing an upload script in asp.net. Much cleaner and simpler. For reference, here it is:

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim SourceFile As HttpPostedFile As HttpPostedFile
'Fetch source file and save it to disk
SourceFile = Request.Files("file")
'Save the file with the record ID as the name
Dim strFileName As String = Request.QueryString("docID") & ".pdf"
SourceFile.SaveAs (Server.MapPath("/docs/" & strFileName))
response.Redirect("docuploadcomp.asp")
End Sub
</script>

I've successfully uploaded 10mb files with this.
 
I've written an upload script in ASP which gets around the win2003 setting anyway, if anyone needs it. No component required and is very fast. pm me if anyone wants a copy.
 
Antic,

Feel free to share in the Code Snips section of the forum, its there for that.
 
I wonder if the problem was in SmartUpload then? If it's unregistered perhaps there's a limit built in?
 
antic said:
I wonder if the problem was in SmartUpload then? If it's unregistered perhaps there's a limit built in?

I don't think so, as this happened with a self-contained asp script I commonly use as well.

Stephen, what are smartupload tools? Just the usual bits from aspsmartupload? Googling them returns no results...
 
Hafa,

Download the files from their page, you will see the tools DLL that needs to be placed in system32, no meniton of it really, just in the downloads and I think mentioned in the readme in the download.
 
Back
Top