문제

I am trying to use the plupload flash widget as it works in all browsers for multiple image upload.

For every image I want my users to select a property from a dropdown box. As every image used in my site represents a property image type ex- rear image, side image, front image etc.. these options will be in the dropdown.

I would like to know, if I can dynamically inject a dropdown to pluploader. Here is an image to see as how exactly I would like to have the drop down box for every image.

enter image description here

http://www.diigo.com/item/image/2ma3g/9wsq

도움이 되었습니까?

해결책

Upon inspection of the jQuery queue element it is easy enough to determing how to inject your dropdown box into the DOM.

enter image description here

Because it is based on jQuery you can simply use something like..

$('#uploader_filelist li').each(function(index,data){
  $(this, '#plupload_file_name').append('<html>Your html here</html>');
});

That is a very simple sample but that is how you would inject markup dynamically into the queue.

The problem is when you do it? And how to identify it later. With this you need to go back to the plupload API and attach events (Documentation here) to the following:

  • public event FilesAdded(uploader:Uploader, files:Array)
  • public event UploadProgress(uploader:Uploader, file:File)

And you will need to handle chunks in the script as well as the uplaod handler you are using to retrieve the dropdown value using multipart_params that get set on each chunk uploaded.

Adding the drop down is easy, making sure the process is handled all the way around is another problem and can take some time to perfect.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top