SibSoft Ltd.
Development Services
software products
 RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
EZYWebhost - Cheap XUpload & XFileSharing 100% campatible hosting

AJAX upload progress bar

File sharing script
How to set and get POST Parameters.

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload
View previous topic :: View next topic  
Author Message
webxmedia



Joined: 25 Aug 2006
Posts: 2

PostPosted: Aug 25, 2006 6:57 pm    Post subject: How to set and get POST Parameters. Reply with quote

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.
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 22 Mar 2006
Posts: 130

PostPosted: Aug 28, 2006 8:17 am    Post subject: Re: How to set and get POST Parameters. Reply with quote

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?


All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.
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
Back to top
View user's profile Send private message Send e-mail
Usagi



Joined: 28 Aug 2006
Posts: 5

PostPosted: Aug 28, 2006 3:40 pm    Post subject: ?url_post ? Reply with quote

Quote:
All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.


I do not find "url_post" anywhere 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;
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 22 Mar 2006
Posts: 130

PostPosted: Aug 29, 2006 8:25 am    Post subject: Re: ?url_post ? Reply with quote

Usagi wrote:
Quote:
All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.


I do not find "url_post" anywhere in XuploadConfig.pm.


If you can't find post url - then you're using XUpload Free, not XUpload Pro.
Back to top
View user's profile Send private message Send e-mail
webxmedia



Joined: 25 Aug 2006
Posts: 2

PostPosted: Sep 03, 2006 9:37 pm    Post subject: POST data in PHP not displaying all variables. Reply with quote

[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
Back to top
View user's profile Send private message
admin
Site Admin


Joined: 22 Mar 2006
Posts: 130

PostPosted: Sep 05, 2006 5:53 am    Post subject: Re: POST data in PHP not displaying all variables. Reply with quote

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.


Hello,

please email us (info@sibsoft.net) link to your upload form and give us FTP connection info if possible. We will take a look at your installation.

Thanks.
Back to top
View user's profile Send private message Send e-mail
Manfred Kooistra



Joined: 02 Jan 2007
Posts: 4

PostPosted: Jan 02, 2007 1:30 am    Post subject: Re: ?url_post ? Reply with quote

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.

admin wrote:
Usagi wrote:
Quote:
All additional fields will be posted "as is" to "url_post" URL specified in XUploadConfig.pm.


I do not find "url_post" anywhere in XuploadConfig.pm.


If you can't find post url - then you're using XUpload Free, not XUpload Pro.


In the features list at http://www.sibsoft.net/xupload.html#features you claim that even XUpload Free will pass on the POST data.

How?

Or maybe you should change the features list ...
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Jan 11, 2007 6:34 am    Post subject: Reply with quote

Both XUpload FREE & Pro do have url_post parameter. Probably you used redirect_link and removed url_post from config.
Using redirect_link parameter you can not send POST data, only redirect.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Manfred Kooistra



Joined: 02 Jan 2007
Posts: 4

PostPosted: Jan 11, 2007 11:37 pm    Post subject: Reply with quote

admin wrote:
If you can't find post url - then you're using XUpload Free, not XUpload Pro.


I take that to mean that there is no post url in XUpload Free.

PilgrimX182 wrote:
Both XUpload FREE & Pro do have url_post parameter.


I just downloaded XUpload Free again and opened XUploadConfig.pm. Here it is:

Code:
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;


Maybe I'm blind, but I truly can't find url_post in there.

PilgrimX182 wrote:
Probably you used redirect_link and removed url_post from config.


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.

Or do you mean that I should put it in ?!?
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Jan 12, 2007 8:04 am    Post subject: Reply with quote

Well...you're right...partially. There's no url_post inside free config. It's like a bit hidden feature Smile

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 Smile
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group