Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Problem with CGI upload on Windows Server 2003

by pernod (Chaplain)
on Feb 25, 2005 at 03:57 UTC ( #434405=perlquestion: print w/replies, xml ) Need Help??

pernod has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I've been struggling with this file-upload thing on a Windows 2003 server for some time now, and was wondering if anyone has solved this problem before. IIS 6 on 2003 server is locked down quite well, so all services are off per default. A good thing, but ...

I have a rather standard Perl CGI form that uploads files to a directory on the server, and this works fine on other Windowses. Problem is that some setting blocks uploading on this server, and I have to use this box.

I tried updating the AspMaxRequestEntityAllowed variable in c:\windows\system32\MetaBase.xml, and restarting the webserver, to no avail. File uploads for .asp-scripts on this server is per default capped to 200KB on IIS 6 on Windows 2003, and I thought changing this would also apply to Perl.

I'll keep digging into this, but any insights would be greatly appreciated.

pernod
--
Mischief. Mayhem. Soap.

Replies are listed 'Best First'.
Re: Problem with CGI upload on Windows Server 2003
by cbrandtbuffalo (Deacon) on Feb 25, 2005 at 11:27 UTC
    Any messages in any logs to indicate what might be blocked?

    I'm sure you've check this, but does the webserver user have permission to write to the directory you're dumping the file in? When I'm debugging, I just make the directory (and parent directories if necessary) fully readable and writable to the world. Then, once you figure it out, start locking it down appropriately for safety. This can also eliminate permissions issues as the source of your problem.

      Well, no messages in the log that helped ... I had already tried to write to a filehandle in the directory in question, without trouble, so the directory permissions were correct.

      In the end I rewrote the script that handled the uploading. The original, which worked fine on XP and IIS 6 used CGI::FormBuilder for validation and field generation. This somehow malfunctioned on the target setup, while a good ole-fashioned backend using only CGI worked. The CGI::FormBuilder version only handled file uploads up to (what seems to me to be) an arbitrary header length. In my case this meant that files under 500 bytes were uploaded, while bigger files were blocked and the script timed out. The CGI version happily handled a 40 MB upload with the same header setup. Strange.

      This may be an issue with CGI::FormBuilder 2.14. I haven't tried updating to the latest version, but maybe this will help. As it is today though, I use CGI::FormBuilder for constructing the front-end with javascript validation, while a basic CGI backend handles the file upload.

      Thanks for your suggestions, though :)

      pernod
      --
      Mischief. Mayhem. Soap.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://434405]
Approved by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2019-08-25 03:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?