Add | on the fly

I am stuck. I use uploadify to upload multiple files to my s3 server. I would like to put each file in a folder with a unique identifier . What I was hoping to do was use this syntax to accomplish this (note that uuid is a jquery plugin for generating uuids):

'onComplete'  : function(event,queueId,fileObj,response) {
   $('#fileInput').uploadifySettings('folder',$.uuid())
}

My problem is that when this callback is called - I no longer have access to $('#fileInput').uploadifySettings(x,y), I realized that this is an undefined method ?!

Other note settings:

'auto':  'true'
'multi': 'true'

and I boot directly to Amazon s3

Has anyone come across this? Ideas on how to solve?

Thank!

+5
source share
3 answers

, scriptData "onSelect", , :

onSelect : function(){
            $('#images_upload_file').uploadifySettings("scriptData", {'yourvar': yourvalue });
        },

, ,

+3

, .

? , - , , , , .

uuid ( , , ).

, , ?

+1

. , , flashvars, Flash.

HTML-:

<div id="file_upload" name="file_upload"></div>

I continue to initiate adding to this element as follows:

$('#file_upload').uploadify({
    // Empty folder path
    'folder'    : ''
});

This adds an element <object>with several children <param>to your HTML file. One of these elements <param>is called "flashvars", and its string value contains the path to the download folder. So, to change the value of a folder, I am looking for this line for the argument "folder =" as follows:

// Find correct <param> element and retrieve it value
var found = $("#file_uploadUploader").find("param[name=flashvars]").val();

// Search within that value for the specific folder argument using a regex
// and replace find with new_path
found = found.replace(/folder\=.*\/&/, "folder="+new_path+"&");

Hope this helps.

0
source

All Articles