Another Uber-Uploader Question

apps

#1

Hi, I’m trying to use Uber-Uploader to allow friends and family to upload pictures taken at my wedding. I have the php files installed in:
/home/gthorne/vickiandgregthorne.com/photos, and the perl file is in /home/gthorne/vickiandgregthorne.com/cgi-bin.

I want to upload to /home/gthorne/vickiandgregthorne.com/photos/uploads
and am using /home/gthorne/vickiandgregthorne.com/phototmp as the temp directory.

When I try to run it, I get the error:
Error: Failed to find flength file

So, I made the recommended changes to the .htaccess in the /home/gthorne/vickiandgregthorne.com/photos/ directory. It now looks like this:

# Turn off mod_security filtering. SecFilterEngine Off

The below probably isn’t needed,

but better safe than sorry.

SecFilterScanPOST Off

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

But I still get the same error. In the ubr_default_config.php, I have set the following option:
$_CONFIG[‘upload_dir’] = $_SERVER[‘DOCUMENT_ROOT’] . ‘/uploads/’;

In the ubr_ini.php file, I set the following:
$TEMP_DIR = ‘/home/gthorne/vickiandgregthorne.com/phototmp/’;
$PATH_TO_UPLOAD_SCRIPT = ‘/cgi-bin/ubr_upload.pl’;

And in the ubr_upload.pl, I set:
my $TEMP_DIR = ‘/home/gthorne/vickiandgregthorne.com/phototmp’;

Sorry if this is too much info, but I wanted to give too much rather than too little. Any help would be appreciated.

P.S. I saw in another post where someone said that you have to make your own PHP.ini in order to do uploads over 5MB, is that true?


#2

Actually, I am getting a different error altogether with your installation:

ERROR: Failed to open config file fb86b9e8052fbfe41c82369c14da88a1.link

It sounds to me like your path(S) might be messed up. Remember that PHP on DreamHost is running PHP-CGI, so certain environment variables might not return what you , or the programmer who wrote the code, might have expected.

[quote]In the ubr_default_config.php, I have set the following option:
$_CONFIG[‘upload_dir’] = $_SERVER[‘DOCUMENT_ROOT’] . ‘/uploads/’;[/quote]
I’d tryh setting that to a “hard-coded” full path as a test. :wink:

It would be if you were relying upon PHP to do the actually uploading, but the nice thing about uber-uploader is that perl does the uploading, so the PHP limitation does not apply (which is why I recommend it for use on DH domains instead of a strictly PHP upload script).

–rlparker


#3

Hmm. Tried that, same result.

It seems it may be something with the path to the temp directory, rather than the uploads directory. It’s able to create the *.temp file, but not able to find it once its created.

Do you know of any working configs, and how they’re set up? Where’s the temp directory located?


#4

Yes, I shared one one my configs recently in a thread on these forums. You can find a working config file here.

In that installation, I created a "temp directory named “tmp” and made it a sub-directory immediately below my web “base” directory.

–rlparker


#5

Hmm, well, I attempted copying every setting that I could (it looks like an older version). The $ENV variables don’t seem to work as well as the $_SERVER (apparently, many of the $ENV variables end up being null). So, my current config looks like this, according the debug_config switch:

[config_file_name] => ubr_default_config
[upload_dir] => /home/gthorne/vickiandgregthorne.com/photos/uploads/
[multi_upload_slots] => 1
[max_upload_slots] => 10
[embedded_upload_results] => 0
[check_file_name_format] => 1
[check_allow_extensions] => 1
[check_null_file_count] => 1
[check_duplicate_file_count] => 1
[show_percent_complete] => 1
[show_files_uploaded] => 1
[show_current_position] => 1
[show_elapsed_time] => 1
[show_est_time_left] => 1
[show_est_speed] => 1
[cedric_progress_bar] => 1
[progress_bar_width] => 400
[get_status_speed] => 1000
[unique_upload_dir] => 0
[unique_upload_dir_length] => 16
[unique_file_name] => 0
[unique_file_name_length] => 16
[max_upload_size] => 2000097152
[overwrite_existing_files] => 0
[redirect_url] => http://www.vickiandgregthorne.com/ubr_finished.php
[redirect_using_location] => 0
[redirect_using_html] => 0
[redirect_using_js] => 0
[allow_extensions] => (wma|wmv|mpg3|mpg|mpeg|avi|mov|jpg|jpeg|gif|bmp|png|tiff)
[normalize_file_names] => 1
[normalize_file_delimiter] => _
[normalize_file_length] => 48
[link_to_upload] => 0
[path_to_upload] => http://www.vickiandgregthorne.com/photots/uploads/
[send_email_on_upload] => 0
[html_email_support] => 0
[link_to_upload_in_email] => 0
[email_subject] => Uber File Upload
[to_email_address] => email1@yoursite.com,email2@yoursite.com
[from_email_address] => admin@yoursite.com
[log_uploads] => 0
[log_dir] => /tmp/ubr_logs/
[opera_browser] => 0
[safari_browser] => 0

So, the question is, how does this differ from your install? Also, are you using an .htaccess?


#6

Yes, from the distro dates I assume the version I am running is an “older” version (Mine was last installed on 7-1-2007, and I notice that the “current” version 6.1 was release on 1-6-2008)

The version I am running runs properly with the default DH PHP4.4.7 and 5.2.2 versions, and I have “extra web security” set to “ON” in the control panel.

I have it configured as follows:

in home/myusesr/mydomain.tld:
uu_conlib.php
uu_fileupload.js
uu_fileupload.php
uu_finished.php
uu_get_status.php
.htaccess

All these files have persmissions set to 0644. The contents of .htaccess are:

[quote][code]

Turn off mod_security filtering.

SecFilterEngine Off

The below probably isn’t needed,

but better safe than sorry.

SecFilterScanPOST Off

mod_gzip_on No [/code][/quote] in home/myusesr/mydomain.tld/cgi-bin: uu_default_config.pm uu_ini_status.pl uu_lib.pm uu_upload.pl

The directory, and all the files in it are set to permissions 755
Here are the contents of my uu_default_config.pm:

[quote][code]package uu_default_config;
use strict;
use Exporter;

@uu_default_config::ISA = qw( Exporter );
@uu_default_config::EXPORT = qw($config);

use vars qw($config);

$config = {
config_file_name => ‘uu_default_config’,
temp_dir => ‘/home/myusername/mydomain.tld/tmp/’,
upload_dir => $ENV{‘DOCUMENT_ROOT’} . ‘/uploads/’,
unique_upload_dir => 0,
unique_upload_dir_length => 16,
unique_file_name => 0,
unique_file_name_length => 16,
max_upload => 2000097152,
overwrite_existing_files => 0,
redirect_after_upload => 0,
redirect_url => ‘http://’ . $ENV{‘SERVER_NAME’} . ‘/uu_finished.php’,
redirect_using_js_html => 1,
redirect_using_html => 0,
redirect_using_js => 0,
redirect_using_location => 0,
delete_param_file => 1,
get_data_speed => 1000,
disallow_extensions => ‘(sh|php|php3|php4|php5|py|shtml|phtml|cgi|pl|plx|htaccess|htpasswd)’,
allow_extensions => ‘(jpg|jpeg|gif|bmp)’,
normalize_file_names => 1,
normalize_file_delimiter => ‘_’,
normalize_file_length => 32,
link_to_upload => 0,
path_to_upload => ‘http://’. $ENV{‘SERVER_NAME’} . ‘/uploads/’,
send_email_on_upload => 0,
html_email_support => 0,
link_to_upload_in_email => 0,
email_subject => ‘Uber File Upload’,
to_email_address => ‘email_1@somewhere.com,email_2@somewhere.com’,
from_email_address => ‘admin@yoursite.com’,
};

1;[/code][/quote]
One of the ways our config files differ is that you have not “quoted” your path_to_upload, disallow_extensions, and certain other variable assignments.

I have directories “uploads” and “tmp” as sub-directories immediately beneath mydomain.tld in the directory tree, and they are set to permissions 755.

–rlparker


#7

[path_to_upload] – has a typo (photots).


#8

Thanks, just fixed that. That doesn’t seem to be the main issue, but I’m sure that would’ve snagged me down the line.


#9

Maybe tmp_dir needs to be more complete.

Paste this in your fav editor : <?php $p = getcwd() ; echo $p;?>

Save as cwd.php, upload to your tmp dir, call it in your browser.

Include a space before the 1st period in path_to_upload