XUpload - Upload status not available until upload finished

Message
Author
noel
Posts: 1
Joined: Sep 15, 2006 3:48 am

Upload status not available until upload finished

#1 Postby noel » Sep 15, 2006 3:54 am

I've been trying the XUpload free version. Seems to work great on your site, but when I try it on mine, the status window remains blank until the upload is complete and then quickly advances to 100%.

I added some debug code to upload_status.cgi so that it did not attempt to monitor the upload, but just printed a "Hello" to show that the script was running. Again, it doesn't run until the upload is completed.

I can ssh into the server and watch the temp file grow so I know that the file is uploading. So it seems that my server is running the upload and then switching its attention to the waiting upload_status.cgi code.

Maybe its an Apache server setting. Any ideas? I'm running Apache 2.0 and I see you're running 1.3 so its not some new feature.

tubbly
Posts: 18
Joined: Sep 06, 2006 10:59 pm

#2 Postby tubbly » Sep 18, 2006 3:14 pm

Is it caused by your server buffering the uploads?
I added a .htaccess file to the folder my XUpload cgi scripts are in as follows:

SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"

This did the trick for me.

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

#3 Postby PilgrimX182 » Sep 19, 2006 5:43 am

tubbly wrote:Is it caused by your server buffering the uploads?
I added a .htaccess file to the folder my XUpload cgi scripts are in as follows:

SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"

This did the trick for me.
Thanks tubbly,

yes, this should help. Make sure .htaccess enabled on your server.

Code: Select all

<IfModule mod_security.c>
SetEnvIfNoCase Content-Type \
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>

al
Posts: 1
Joined: Sep 22, 2006 11:42 am

#4 Postby al » Sep 22, 2006 11:56 am

Hi there,

i think i got a problem similar to this, but i'm not sure cause the soloution described above doesn't work for me. my server admin installed mod_securitry and i placed the scheduled .htaccess file in the same folder as the *.cgi scripts (yes, htacces is active in the server). it seems like the script can't work problably as it is, cause the upload_status.cgi is running untill the file is uploaded

Code: Select all

while( -e $flength_file ... ) { ... } 
(cause the flength file is removed after upload with upload.cgi has finished)

i think if it was like in php, the output is sent to the browser after the script was interpretet serverside. that means it could only make the output when file is already uplaoded...!?

can andybody help?

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

#5 Postby PilgrimX182 » Sep 22, 2006 12:39 pm

No. We turn on output flushing in upload_status.cgi.
90% it's mod_security or mod_gzip

try to add mod_gzip fix to .htaccess:

Code: Select all

<IfModule mod_gzip.c>
mod_gzip_on No
</IfModule>
probably there are some other weird mods we haven't met yet.

tubbly
Posts: 18
Joined: Sep 06, 2006 10:59 pm

#6 Postby tubbly » Sep 22, 2006 1:13 pm

I don't know if this will help, but when I put the full code that was suggested:
<IfModule mod_security.c>
SetEnvIfNoCase Content-Type \
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>


in the .htaccess file it didn't work.

I tried it just without the IfModule part:
SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"

and this worked for me.

pinesystems
Posts: 6
Joined: Apr 25, 2007 5:09 am

#7 Postby pinesystems » Apr 25, 2007 6:23 am

My problem is when I upload a 1.2 MB byte, the pop-up window is blank
until it is about 69% complete
The 2nd time it updates the screen is when it is 100%.

I keep checking the file folder and the file won't appear until it is 100% complete.

Once in a while, the pop-up screen shows "Update failed", but the file is still uploading.
The file is uploaded correctly in the folder when it finishes.

The following is the URL to upload a file.

http://www.printer4printers.com

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

#8 Postby PilgrimX182 » Apr 25, 2007 7:03 am

First of all it looks you haven't copied Style files to your server or made some script modifications yourself. But that's not the problem.

Do you have .htaccess file in your cgi-bin folder? Is it enabled?

pinesystems
Posts: 6
Joined: Apr 25, 2007 5:09 am

#9 Postby pinesystems » Apr 25, 2007 4:58 pm

I have a .htaccess in the cgi-bin folder (access rights:
-rwxr-xr-x)

The content of .htaccess file is as follows:

# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI

<IfModule mod_security.c>
SetEnvIfNoCase Content-Type \
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>

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

#10 Postby PilgrimX182 » Apr 26, 2007 5:26 am

Try this .htaccess:

Code: Select all

# General Apache options 
AddHandler fastcgi-script .fcgi 
AddHandler cgi-script .cgi 
Options +FollowSymLinks +ExecCGI

<IfModule mod_security.c>
SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>

<IfModule mod_gzip.c>
mod_gzip_on No
</IfModule>

pinesystems
Posts: 6
Joined: Apr 25, 2007 5:09 am

#11 Postby pinesystems » Apr 26, 2007 4:09 pm

I copied the code that you suggested, but I have to comment the line
Options +FollowSymLinks +ExecCGI
in the .htaccess file, otherwise it causes an internal error.

Nevertheless, it still does NOT work (same as before)
My httpd.conf content is as follows:

Please advise



ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 120
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 2
MinSpareServers 1
MaxSpareServers 5
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 4000
</IfModule>
<IfModule worker.c>
StartServers 2
MaxClients 10
MinSpareThreads 1
MaxSpareThreads 4
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
Listen 80
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule auth_ldap_module modules/mod_auth_ldap.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule cache_module modules/mod_cache.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule cgi_module modules/mod_cgi.so
Include conf.d/*.conf
User apache
Group apache
ServerAdmin root@localhost
UseCanonicalName Off
DocumentRoot "/var/www/html"
<IfDefine !tmpl_openwebmail-as4>
ScriptAlias /mail /var/www/cgi-bin/openwebmail/openwebmail.pl
</IfDefine>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disable
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
#UserDir public_html
</IfModule>
DirectoryIndex index.html index.shtml index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig /etc/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
EnableSendfile off
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log combined
ServerSignature On
Alias /icons/ "/var/www/icons/"
<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule mod_dav_fs.c>
# Location of the WebDAV lock database.
DAVLockDB /var/lib/dav/lockdb
</IfModule>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
IndexOptions FancyIndexing VersionSort NameWidth=*
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
ForceLanguagePriority Prefer Fallback
AddDefaultCharset UTF-8
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler imap-file map
AddHandler type-map var
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/error/"
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory "/var/www/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback
</Directory>
</IfModule>
</IfModule>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
NameVirtualHost 216.154.208.62:80
<VirtualHost 216.154.208.62:80>
<Directory /home/webadmin/printer4printers.com/html>
Options Indexes Includes FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/webadmin/printer4printers.com/cgi-bin>
AllowOverride All
</Directory>
<Location /cgi-bin>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options +ExecCGI
PerlSendHeader On
Allow from all
</Location>
Alias /webmail /var/www/html/webmail
ScriptAlias /spamassassin /var/www/cgi-bin/spamassassin/index.pl
Alias /sa-images /var/www/html/spamassassin
Alias /myadmin /var/www/html/myadmin
Alias /pgadmin /var/www/html/pgadmin
ScriptAlias /mail /var/www/cgi-bin/openwebmail/openwebmail.pl
ScriptAlias /cgi-bin/openwebmail /var/www/cgi-bin/openwebmail
Alias /openwebmail /var/www/html/openwebmail
JkMount /*.jsp ajp13
JkMount /*.do ajp13
JkMount /admin* ajp13
JkMount /manager* ajp13
JkMount /web-console* ajp13
ScriptAlias /cgi-bin/awstats /var/www/cgi-bin/awstats
Alias /awstats /var/www/html/awstats
ServerName printer4printers.com
DocumentRoot /home/webadmin/printer4printers.com/html
SuexecUserGroup webadmin webadmin
ServerAlias "www.printer4printers.com"
ServerAdmin "[email protected]"
ScriptAlias "/cgi-bin/" "/home/webadmin/printer4printers.com/cgi-bin/"
CustomLog "/home/webadmin/printer4printers.com/access_log" "combined"
ErrorLog "/home/webadmin/printer4printers.com/error_log"
Alias /ldapadmin /var/www/html/phpldapadmin
</VirtualHost>

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

#12 Postby PilgrimX182 » Apr 27, 2007 5:29 am

Try to comment some modules in config, restart Apache and test xupload cause I'm not sured what caused this caching.

Actually Ajax mode should work fine for you. Enable it in config. It was implemented in 2.4 Xupload version, not sured which one you have. You can PM me ftp access to your xupload folder so I could tune this up quickly.

pinesystems
Posts: 6
Joined: Apr 25, 2007 5:09 am

#13 Postby pinesystems » Apr 27, 2007 6:02 am

I pm my FTP upload info. to you a couple of minutes ago.

Thanks,
Jimmy

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

#14 Postby PilgrimX182 » Apr 27, 2007 7:33 am

Yeah, it's another weird-server-config case. Server caching output. Not Xupload issue.

pinesystems
Posts: 6
Joined: Apr 25, 2007 5:09 am

#15 Postby pinesystems » Apr 28, 2007 6:40 am

Thank you so much for your help!
I saw the progress bar and percent completion now.

What exactly have you changed?

Also, when I upload a file > 100MB (say 500MB),
it didn't report "File exceeds max. limit.)
I saw the following "Internal Server Error" message on the pop-up window.

When I upload a very small file (say < 100 bytes),
I saw the same "Internal Server Error" message.
though the small file was uploaded successfully.

I didn't see anything unusual in the error log file.

Thanks,




Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.