2010-11-29 21 views
0

Salut quelqu'un peut-il expliquer comment le post_param est utilisé dans SWFUpload. J'ai besoin de la valeur pour name = 'batchid' chargé quand je soumets. c'est ce que l'exemple doc montreaprès l'utilisation des paramètres pour SWFUpload?

post_params : { 
    "post_param_name_1" : "post_param_value_1", 
    "post_param_name_2" : "post_param_value_2", 
    "post_param_name_n" : "post_param_value_n" 
}, 

Répondre

1

Avez-vous essayé:

post_params : { 
    "name" : "batchid" 
} 

Si batchid est une variable (je devine donc) définir en utilisant votre php et l'appeler comme var js normale :

post_params : { 
    "name" : batchid 
} 
0

des variables Ajouter POST après l'initialisation SWFUpload:

 var form = document.adminForm; 
     if (form.catid.value == "0"){ 
    alert("<?php echo JText::_('You must select a category', true); ?>"); 
     } else { 
      var radio = $('adminForm').value;  
      upload1.addPostParam("published" ,radio), 
      upload1.addPostParam("cat_id" , document.adminForm.catid.value); 
      upload1.addPostParam("MAX_FILE_SIZE" ,"5000000"); 
      upload1.addPostParam("UPLOAD_MAX_FILESIZE" ,"5000000"); 
     upload1.startUpload(); 
     } 


      var upload1; 
     window.onload = function() { 
    upload1 = new SWFUpload({ 
    post_params: {}, 
     upload_url: "upload.php", 
      file_size_limit : "1024", 
      ... 

      })