RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
xmode does not function

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



Joined: 25 Jul 2009
Posts: 3

PostPosted: Aug 11, 2009 11:48 am    Post subject: xmode does not function Reply with quote

I have a form passing this variable:
Code:
<input type="hidden" name="xmode" id="xmode" value="2">
<input type="hidden" name="pbmode" id="pbmode" value="2">


In the file XUPLOADCONFIG.pm i have the settings
Code:

modes =>
 {
   1 =>
   {
      # Directory for uploaded files
      target_dir      => '/home/www/web2/html/uploads/',
     
      # URL to send all input values from upload page
      #url_post        => 'http://sds:8071/cgi-bin/UPLOAD2/post2.cgi',
      url_post        => 'http://www.abc.net/uploader/post.php',
     
      # Max number of upload fields
      max_upload_files => 5,
     
      # Minimum/Maximum Total upload size limit in MBytes (empty or zero to disable)
      min_upload_size => 0,
      max_upload_size => 500,

      # Minimum/Maximum upload Filesize limit in Mbytes (empty or zero to disable)
      min_upload_filesize => 0,
      max_upload_filesize => 20,
     
      # Allowed file extensions delimited with '|'
      # Use '.*' to allow all extensions
      #ext_allowed     => 'jpg|jpeg',
      ext_allowed     => '.*',

      # Not Allowed file extensions delimited with '|'
      # Leave it blank to disable this filter
      ext_not_allowed => '',
   },
   2 =>
   {
      target_dir      => '/home/www/web1/html/intern/fiches/',
      url_post        => 'http://www.dfg.net/fiches/post.php',
      max_upload_files => 5,
      min_upload_size => 0,
      max_upload_size => 500,
      min_upload_filesize => 0,
      max_upload_filesize => 20,
      ext_allowed     => '.*',
      ext_not_allowed => '',
   },
 },


But everytime files are uploaded in the folder specified in mode number 1 and i ma redirected to post file specified in mode number 1.

No settings of mode number 2 are being considered (nor for upload nor for post-redirect)

whats wrong?
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 2109
Location: UFO Lab

PostPosted: Aug 11, 2009 11:56 am    Post subject: Reply with quote

What XUpload version?
In latest 3.1 mode setting via JavaScript like this:
Code:

<Script>
var x_mode = 1;
</Script>


check default sample.
Back to top
View user's profile Send private message Visit poster's website
yixiazi



Joined: 03 Dec 2009
Posts: 2

PostPosted: Dec 03, 2009 5:29 pm    Post subject: Reply with quote

In the documentation above the mode settings in my XUploadConfig.pm it says:

Quote:

# You can use different upload modes for different upload forms
# Specify upload mode in xmode hidden input in upload_form.html


I have done this and it continues to use the default cgi-bin/uploads directory even though in my XUploadConfig.pm I have specified it to use another folder.

target_dir => '[my root path here]/uploads/files/transfer',

How do I remedy this?
Back to top
View user's profile Send private message
yixiazi



Joined: 03 Dec 2009
Posts: 2

PostPosted: Dec 03, 2009 5:33 pm    Post subject: Reply with quote

This does not work:

<input type="hidden" name="x_mode" id="x_mode" value="1">

This does not work either:


<input type="hidden" name="xmode" id="xmode" value="1">

As a further note I specified the following in the javascript file

Code:

if(!window.x_mode)x_mode=1;

/*
After the above statement I tried the one below as a test
*/

x_mode=2;


That did not work either. As a matter of fact, in both mode 1 settings and mode 2 settings I have specified directiories other than the cgi-bin/uploads folder, but to no avail. This means to my mind that the cgi-bin/uploads/ folder is hard-coded in somewhere that is causing the script to completely ignore the XUploadConfig.pm target_dir array variable.

I know this because when I do switch modes in the javascript it responds by using my ext_allowed settings. This lets me know the script has stepped into the right mode, yet ignores my different upload directory settings just the same.
Back to top
View user's profile Send private message
sffc



Joined: 16 Aug 2010
Posts: 1

PostPosted: Aug 16, 2010 9:26 am    Post subject: Reply with quote

Sorry to bump an old topic, but I was having this problem too, and I found a fix. In upload_form_tiny.html, where it says:
Code:
<script type="text/javascript">
var x_form_id = 'myform';
</script>

Put:
Code:
<script type="text/javascript">
var x_form_id = 'myform';
var x_mode = 3;
</script>

It actually mentions this in INSTALL.txt. Worked fine for me after this change.

I think yixiazi was missing the "var" keyword.
Back to top
View user's profile Send private message
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