in reply to Re: how to put values into $$rhash_params{'import_file'}->filename?
in thread how to put values into $$rhash_params{'import_file'}->filename?
this is the default method for uploading files using modcgi page via apache. but my problem is that i'm trying to upload files directly from the server bypassing this uploading modcgi page. unfortunately, most of the functions in my company uses hash{param} method to store parameters, so the file handler and the file name is actually kept using this method. so i need to find a way to put in the file name and the file handle parameter to the $$rhash_params variable so i can minimize changes to the functions that i'm using. thanks for your answer, i try your method and using the ->filename i got this error: error Can't modify non-lvalue subroutine call at /script.pm line 1467.\n and using the {}{} method i got this error msg: error Not a HASH reference at /media/www/vprimary/script.pm line 1468.\n from using data dumper this is what i've got:#------------------------------------------------------ # Handle all POST, GET, multipart, and upload requests #------------------------------------------------------ my $r = Apache->request(); my $apr = Apache::Request->new($r); my @keys = $apr->param; foreach (@keys) { my @value = $apr->param($_); next unless scalar @value; if (@value>1){ $params{$_} = \@value; } else { $params{$_} = $value[0]; } } my $upload = $apr->upload; if ($upload) { $params{'import_file'} = $upload; }
any idea how do i put values into the import file or file handler? thanks & sorry for the belated reply. ~perlnoobian$VAR1 = { 'file_handler' => bless( \*Apache::Upload::_GEN_2410, 'Apach +e::Upload' ), 'import_file' => bless( do{\(my $o = 447703164)}, 'Apache::U +pload' ), };
|
|---|