April 13th, 2003, 08:16 PM
ASP - Server.ScriptTimeout (SAFileup) Problem
i'm sooo confused and stuck here.
i'm using SAFileup to upload files to an IIS server. whenever i try to upload anything over 1.5mb it times out. even when i've bumped up the server.scriptTimeout value to 3600!
tech support at the host (webcentral) say they have no problems uploading a 3mb file. I'm on cable uploading at 20k/s so it shouldn't take long to upload a 3mb file at all....
Below is the code i got from the host to test with. they say it works fine but all my uploads time out. I've tested it on a different computer and ISP (business ADSL) and still the same error.
<%@ Language = "VBScript"%>
'==== Place this file in the virtual directory and create =====
'==== or use an upload directory with modify permissions. =====
'the following three lines of code are used to ensure that this page is not cached on the client.
response.cachecontrol = "no-cache"
response.addheader "pragma", "no-cache"
response.expires = -1
'do we ask for the file to upload - "" or do we just upload the file now - "yes"
upload_now = request.querystring("upload_now")
'sub_dir = request.form("sub_dir")
'lets check the querystring to see what to do
select case upload_now
'OK so we are going to show the upload form...
'first specify a directory with RWD permissions
if sub_dir = "" then
sub_dir = "a directory with RWD permissions"
'where has this script been placed within the website?
virtual_path = Request.ServerVariables("PATH_INFO")
physical_path = Server.MapPath(virtual_path)
upload_path = Server.MapPath(sub_dir)
'Response.Write "Virtual path: <b>" & virtual_path & "</b><br />"
'Response.Write "Physical path: <b>" & physical_path & "</b><br />"
'Response.Write "Upload path: <b>" & upload_path & "</b><br />"
Server.ScriptTimeout = 3600
response.write "Server.ScriptTimeout = " & Server.ScriptTimeout
<form enctype="multipart/form-data" name="uploader" method="post" action="saf_test.asp?upload_now=yes"><br>
<input type="file" name="file_name" size="20"><br />
The upload Directory?: <br />
<input type="text" name="sub_dir" value="test/" size="30"><br />
<input type="reset" value="Reset" name="reset"> ::
<input type="submit" value="Submit" name="submit"><br />
'Now we are going to upload the file
'response.write "upload_now: <b>" & upload_now & "</b><br>"
'---- instanciate SAFileUp ----
Set upl = Server.CreateObject("SoftArtisans.FileUp")
'---- the upload path e$\Inetpub\svc226\sub\directory\whatever
sub_dir = upl.Form("sub_dir")
'virtual_path = Request.ServerVariables("PATH_INFO")
'response.write "virtual_path: " & virtual_path & "<br>"
'physical_path = Server.MapPath(virtual_path)
'response.write "physical_path: " & physical_path & "<br>"
upload_path = p_path & sub_dir
response.write "upload_path: " & upload_path & "<br>"
upl.Path = upload_path
'---- check to see if the field is empty or not
for each item in upl.form
if Not IsObject(upl.form(item)) Then
if upl.Form(item).isEmpty Then
'---- get the filename
file_name = Mid(upl.Form(item).userfilename,instrrev(upl.Form(item).userfilename,"\")+1)
response.write "file_name:" & file_name & "<br>"
'---- upload the image when permissions are applied
upl.Form(item).SaveInVirtual upload_path & file_name
'---- and view data
response.write "<br /><center>Type: "
response.write " | Size: "
response.write " bytes | filename: " & file_name & " <center><br /><br /> has been uploaded </b><br /><a href='saf_test.asp'>:: go back ::</a><br /></center>"
'---- all done
the error is:
error 'ASP 0113'
Script timed out
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeOut or by changing the value in the IIS administration tools.
Last edited by spoonman; April 15th, 2003 at 02:32 AM.
April 14th, 2003, 03:18 PM
It looks like you have the script timeout set to 700 seconds which is ruffly 12 mins. Are you taking longer than 12 mins to upload the file? Also is this just starting or has it always been this way? What I mean is could you ever upload files larger than 2MB?
April 15th, 2003, 02:33 AM
i've modified my original post.
since i started developing on this site its been happening yeah.
April 15th, 2003, 03:11 PM
Well I have no idea. Could you goto the website of who ever makes SAFileup and get support there?
April 15th, 2003, 06:32 PM
webcentral kept giving me test ASP files and the last one actually always worked
i think they decided to use an explicit path to the upload directory.
thanks for trying to help