XUpload - Has anyone had success with Windows/IIS?

Message
Author
PeterC
Posts: 10
Joined: Dec 11, 2007 5:45 pm

Has anyone had success with Windows/IIS?

#1 Postby PeterC » Dec 11, 2007 6:14 pm

Seem to have read just about every post but still am nowhere near getting XUpdatePro to work on IIS6

Does anyone have experience with getting this great code to run on IIS/Windows 2003 Server and can tell me what I'm doing wrong?

I've installed the latest version of ActivePerl in C:\Perl
Verified Perl is working with perl - v from the command line.
Made sure the .pl and .cgi extensions are mapped to PerlIS.dll
Enabled Perl extensions.

Created a virtual Directory /cgi-bin that points to C:\Perl\bin
Copied all directories and files to C:\Perl\bin\xuploadpro\

Modified the upload.cgi and upload_status.cgi to include:
#!Perl - at the top of the page
and
use lib 'c:/Perl/bin/xuploadpro';
chdir('c:/Perl/bin/xuploadpro');

Tried various combinations of Temp_Dir which include
'C:\Perl\bin\xuploadpro\temp'
'C:/Perl/bin/xuploadpro/temp'
'/temp'
'\temp'

Same for the Uploads dir.

Moved the HTML examples with xupload.js to the web root.
Modified the form action to point to '/cgi-bin/upload.cgi?upload_id='

When I run the upload_form.html I get a javascript error of
line 447 "max_upload_files" is undefined as soon as the page loads

When I run the upload_form_tiny.htm it loads fine, allows me to browse for a file, but selecting a file causes an error popup of
line 146 "ext_allowed" is undefined.

If I run http://localhost/cgi-bin/xuploadpro/upload.cgi

I get the status page that say 0 files uploaded, but no error messages to suggest the cgi is running fine.

Seems like the vars from XUploadConfig.pm are not being read.

I've tried just about every combination of directory permissions, but to no effect.

Definately pulling hair out!

Any advice would be much appreciated.

Thanks
Peter

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Dec 12, 2007 6:25 am

Try
http://localhost/cgi-bin/xuploadpro/upl ... e=settings

Also try

Code: Select all

use lib 'c:\Perl\bin\xuploadpro';
or

Code: Select all

use lib 'c:\\Perl\\bin\\xuploadpro';
For temp & uploads dir can use relative path: 'temp', 'uploads'

If no luck we can try to make it work if you give us FTP access in PM.

PeterC
Posts: 10
Joined: Dec 11, 2007 5:45 pm

#3 Postby PeterC » Dec 12, 2007 12:47 pm

Thanks PilgriMX182!

Not there yet - but getting much closer...

Calling the upload.cgi with mode=settings showed upload.cgi could not find the XUploadConfig.pm

Changing to either
use lib 'c:\Perl\bin\xuploadpro';
or
use lib 'c:\\Perl\\bin\\xuploadpro';
worked and now the link is returning the require JS vars.

good so far....

Now when I load the Upload_form.html the form shows the file size and number limits and allows me to select multiple files. (good)

Problem:
When I hit Upload Files I get a JS error popup that says
"Fatal Error: Can't open log file"

Can you help on this one?

Thanks
Peter

PeterC
Posts: 10
Joined: Dec 11, 2007 5:45 pm

#4 Postby PeterC » Dec 12, 2007 1:00 pm

Okay - think I've found the problem.

I changed properties of the logs.txt file to add the 'Internet Guest Account' and gave it permission to read/write/modify.

Still testing, but everything is looking good at the moment!

Best wishes
Peter

PeterC
Posts: 10
Joined: Dec 11, 2007 5:45 pm

#5 Postby PeterC » Dec 12, 2007 8:46 pm

Managed to get XUploadPro working locally and works fine when accessed from a remoted computer. Great code!

I installed on the production server and hit the JS problem that returned
Expected ';'

Ran the .../upload.cgi?mode=settings and get a different response between local computer and production server. Both machines are running Win2003/IIS6.

Local computer (XUploadPro working) returns:

var ext_allowed='';var ext_not_allowed='';var max_upload_files=10;var max_upload_size=0.0;var descr_mode=0;var pass_required='';var email_required='';

Production Server (XUploadPro NOT working) returns:

Content-type: text/html var ext_allowed='';var ext_not_allowed='';var max_upload_files=10;var max_upload_size=0.0;var descr_mode=0;var pass_required='';var email_required='';

Could the additional text (Content-type: text/html) at the beginning be corrupting the JS insert?

If so, any idea wht's causing a different output?

Thanks
Peter

PeterC
Posts: 10
Joined: Dec 11, 2007 5:45 pm

#6 Postby PeterC » Dec 13, 2007 12:57 pm

Cause Found!

Win2003/IIS6 on both servers.

With a little guidance from Pilgrim, the different output was caused by me using the Perl Isapi DLL on the server for CGI extensions (perlis.dll) where I'd used perl.exe on the local server.

All works fine now I'm using perl.exe.

Peter

admin
Site Admin
Posts: 1839
Joined: Mar 22, 2006 12:32 pm

#7 Postby admin » Dec 13, 2007 1:07 pm

Nice!
So what were the step to make it work on Win/IIS?
1) #!Perl instead of #!/usr/bin/perl
2) add "use lib 'C:\.....';"
3) add "chdir('C:\....');"
4) where it is configured to use perl.exe instead of perlis.dll?

so I will add this small guide to Troubleshooter section.

PeterC
Posts: 10
Joined: Dec 11, 2007 5:45 pm

#8 Postby PeterC » Dec 13, 2007 2:01 pm

Also used full location for temp and upload dirs - 'c:\uploads'

I then used Windows explorer and browsed to all files concerned including CGI, PM, the log files and temp and upload dirs - right-click - properties-security to give the IIS Guest USER read/write/execute permissions - I'm still tested what the minimum permission is to maintain best security.

Installed ActivePerl.
This configured the .pl and .plx extensions - you'll need to add the .cgi extension manually.

In IIS manager..
1. Select Properties for the web site (or web sites folder for all sites)
2. Select Home Directory Tab - Configuration
3. Add new extension CGI and browse to the Perl/bin dir to get perl.exe - you need to use C:\Perl\bin\perl.exe "%s" %s if you've used the default Perl install.

NOTE: changing this did remove the content text mentioned in the previous post and XUpload now works fine on my production server. BUT found my local setup is using perlis.dll for cgi extensions - and works fine ???. I just tried changing the production server back to perlis.dll and it coughed out the content text such the JS insert fails. Reverted to perl.exe as above and it's fine.

Peter