0

我一直在阅读 Jquery 文件上传 wiki,但没有遇到有关如何即时修改服务器上传文件夹的示例。是否有关于如何以编程方式修改 php 服务器上传目录的工作示例?

4

1 回答 1

0

这基本上与 JQuery Fileupload 文档无关,我对此进行了更多解释。

//You should bind this to the same object you setup the fileupload on
$('#fileupload').bind('fileuploadsubmit', function (e, data) {
    // The example input, doesn't have to be part of the upload form
    var input = $('#inputWithVariable');

    //Add the new value as a variable called "folder" which will tell you which
    //directory they selected
    data.formData = {folder: input.val()};

    //Optional validation to make sure the input value exists
    if (!data.formData.example) {

     //If the value does not exist, return focus to the input 
     //or maybe select in your case and return false to prevent the upload
      input.focus();
      return false;
    }
});
于 2013-05-01T03:50:00.037 回答