HI I'm using XUpload Pro 2.x to upload gallery pictures, but also in the same form users enter in address details, account details etc. Trouble is I don't know how to send these additional form fieds once XUpload is submitted, because they don't appear to be posted by default. Does anyone know how to set POST variables in XUpload?
I'm using the following code to retrieve the vars in php, but of course it only gets what has been posted. How can I add additional fields to the posted form data?
$PARAM
= array_merge($_GET, $_POST);
$s = $PARAM['s']; # a scalar
$m = $PARAM['m']; # an array
$param_names = array_keys($PARAM);
$param_values = array_values($PARAM);
$num_params = count($PARAM);
for ($x=0; $x<$num_params; $x++) {
echo $param_names[$x]." : ".$param_values[$x]."<br />";
}
Really appreciate any sound advice. Thanks in anticipation.
XUpload - How to set and get POST Parameters.
Re: How to set and get POST Parameters.
All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.webxmedia wrote:HI I'm using XUpload Pro 2.x to upload gallery pictures, but also in the same form users enter in address details, account details etc. Trouble is I don't know how to send these additional form fieds once XUpload is submitted, because they don't appear to be posted by default. Does anyone know how to set POST variables in XUpload?
I'm using the following code to retrieve the vars in php, but of course it only gets what has been posted. How can I add additional fields to the posted form data?
So, for example you have "address" text input in your form.
Then in your PHP script, you should refer to it as:
$address = $_POST['address'];
As we said, XUpload is absolutely transperent.
Let me know if you will have any problems.
Thanks
?url_post ?
I do not find "url_post" anywhere in XuploadConfig.pm.All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.
My XuploadConfig.pm:
package XUploadConfig;
BEGIN
{
use Exporter;
@XUploadConfig::ISA = qw( Exporter );
@XUploadConfig::EXPORT = qw( $c );
}
our $c=
{
# Directory for temporary using files
temp_dir => '/home/mysite/cgi-bin/xupload/temp',
# Directory for uploaded files
target_dir => '/home/mysite/cgi-bin/xupload/uploads',
# Path to the template using for upload status window
templates_dir => '/home/mysite/cgi-bin/xupload/Templates',
# Allowed file extensions delimited with '|'
ext_allowed => 'jpg|jpeg|gif|png|rar|zip|mp3|avi|txt|csv',
# The link to redirect after complete upload
# This setting can be submitted from HTML form, then it will have priority
redirect_link => 'http://mysite.com/image_upload.php',
# Max length of uploaded filenames(without ext). Longer filenames will be cuted.
max_name_length => 64,
# Type of behavior when uploaded file already exist on disc. Available 3 modes: Rewrite/Rename/Warn
copy_mode => 'Rename',
# Maximum total upload size in Kbytes
max_upload_size => 700000000,
# Time to keep temp upload files on server, sec (24 hours = 86400 seconds)
temp_files_lifetime => 86400,
# CSS names
styles => { 'black' => 'black.css',
'hitech' => 'hi_tech.css',
'aqua' => 'aqua.css',
'tiny' => 'tiny.css',
'contrast'=> 'contrast.css',
},
# Template names
templates => { 'simple' => 'simple.html',
'hitech' => 'hitech.html',
'nice' => 'nice.html',
},
};
1;
Re: ?url_post ?
If you can't find post url - then you're using XUpload Free, not XUpload Pro.Usagi wrote:I do not find "url_post" anywhere in XuploadConfig.pm.All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.
POST data in PHP not displaying all variables.
[I'm using the pro version code]
I'm having problems accessing all the post variables when I submit more than 1 file using any of the html_forms. I only seem to be able to view the data for one of the attached files even though you can clearly see from the sample below that 2 files were successfully attached and processed. The post url is a php file.
When I use the supplied perl post file it works but I have no perl experience and really need this to work in php. Would appreciate any advice as I've tried every way I know to extract the post data but every time I just get the data for 1 of the attached files.
file1x : image5.jpg
file1x_original : image.jpg
file1x_status : renamed
file1x_size : 91299
ext_folder :
email_notification :
target_dir : uploads
number_of_files : 2
I'm having problems accessing all the post variables when I submit more than 1 file using any of the html_forms. I only seem to be able to view the data for one of the attached files even though you can clearly see from the sample below that 2 files were successfully attached and processed. The post url is a php file.
When I use the supplied perl post file it works but I have no perl experience and really need this to work in php. Would appreciate any advice as I've tried every way I know to extract the post data but every time I just get the data for 1 of the attached files.
file1x : image5.jpg
file1x_original : image.jpg
file1x_status : renamed
file1x_size : 91299
ext_folder :
email_notification :
target_dir : uploads
number_of_files : 2
Re: POST data in PHP not displaying all variables.
Hello,webxmedia wrote:[I'm using the pro version code]
I'm having problems accessing all the post variables when I submit more than 1 file using any of the html_forms. I only seem to be able to view the data for one of the attached files even though you can clearly see from the sample below that 2 files were successfully attached and processed. The post url is a php file.
When I use the supplied perl post file it works but I have no perl experience and really need this to work in php. Would appreciate any advice as I've tried every way I know to extract the post data but every time I just get the data for 1 of the attached files.
please email us ([email protected]) link to your upload form and give us FTP connection info if possible. We will take a look at your installation.
Thanks.
-
- Posts: 4
- Joined: Jan 02, 2007 1:20 am
Re: ?url_post ?
By now I am working with XUpload Pro, but with the Free version I had the same problem that webxmedia and Usagi have had: the POST data is not passed on to the PHP script defined as the redirect_link in XUploadConfig.pm.
How?
Or maybe you should change the features list ...
In the features list at http://www.sibsoft.net/xupload.html#features you claim that even XUpload Free will pass on the POST data.admin wrote:If you can't find post url - then you're using XUpload Free, not XUpload Pro.Usagi wrote:I do not find "url_post" anywhere in XuploadConfig.pm.All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.
How?
Or maybe you should change the features list ...
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
-
- Posts: 4
- Joined: Jan 02, 2007 1:20 am
I take that to mean that there is no post url in XUpload Free.admin wrote:If you can't find post url - then you're using XUpload Free, not XUpload Pro.
I just downloaded XUpload Free again and opened XUploadConfig.pm. Here it is:PilgrimX182 wrote:Both XUpload FREE & Pro do have url_post parameter.
Code: Select all
package XUploadConfig;
BEGIN
{
use Exporter;
@XUploadConfig::ISA = qw( Exporter );
@XUploadConfig::EXPORT = qw( $c );
}
our $c=
{
# Directory for temporary using files
temp_dir => '/.../temp',
# Directory for uploaded files
target_dir => '/.../uploads',
# Path to the template using for upload status window
templates_dir => '/.../Templates',
# Allowed file extensions delimited with '|'
ext_allowed => 'jpg|jpeg|gif|png|rar|zip|mp3|avi|txt|csv',
# The link to redirect after complete upload
# This setting can be submitted from HTML form, then it will have priority
redirect_link => 'http://YOUR-SERVER/.../upload_form.html',
# Max length of uploaded filenames(without ext). Longer filenames will be cuted.
max_name_length => 64,
# Type of behavior when uploaded file already exist on disc. Available 3 modes: Rewrite/Rename/Warn
copy_mode => 'Rename',
# Maximum total upload size in Kbytes
max_upload_size => 700000000,
# Time to keep temp upload files on server, sec (24 hours = 86400 seconds)
temp_files_lifetime => 86400,
# CSS names
styles => { 'black' => 'black.css',
'hitech' => 'hi_tech.css',
'aqua' => 'aqua.css',
'tiny' => 'tiny.css',
'contrast'=> 'contrast.css',
},
# Template names
templates => { 'simple' => 'simple.html',
'hitech' => 'hitech.html',
'nice' => 'nice.html',
},
};
1;
No, I did not remove anything. I downloaded and opened the files and searched. Please let me know in which line of what file of XUpload Free you see url_post.PilgrimX182 wrote:Probably you used redirect_link and removed url_post from config.
Or do you mean that I should put it in ?!?
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Well...you're right...partially. There's no url_post inside free config. It's like a bit hidden feature
In free version you can use 2 ways of defining url_post parameter: using hidden input in html page or using parameter in config, both named 'url_post'.
Just add it manually.
PS: good news 4 u - you're not blind
In free version you can use 2 ways of defining url_post parameter: using hidden input in html page or using parameter in config, both named 'url_post'.
Just add it manually.
PS: good news 4 u - you're not blind