Loading and unloading flash memory to a remote server

I am trying to use uploadify to upload images to a remote server. I did everything I could think of for a cross-scripting problem or something else.

Here is what I did.

scriptAccess to 'Always' in the uploadify function. I have crossdomain.xml on my ww2 server with uploadify.swf in the root. I uploaded the jquery jquery lib file to a remote ww2 server and placed it in the header. I placed jquery.uploadify.js and swfobject.js in the root directory.

If I try to click X to cancel the file, I get the error: Error calling method in NPObject Or loading does not work.

If someone can help with this, it will be great. If there are other good flash-based or non-flash-flash files that will make deleted files without problems, let me know.

thank

+3
source share
2 answers

I managed to figure it out on my own. I will answer it simply because someone else may have this problem, because the authors' website does very little help.

Flash (-), , , , - javscript. Js . , uploadify, , php (uploader.php), -, crossdomain.xml . , , uploader.PHP . . , . . , - . Uploadify - .

+4

uploadify.js:

/* Original code */
 uploadifyCancel:function(ID) {

                            jQuery(this).each(function() {



                               document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, true, false);

                            });

                       },




   /*New code */

    uploadifyCancel:function(ID){

                    jQuery(this).each(function(){

                        document.getElementById(jQuery(this).attr("id")+"Uploader").cancelFileUpload(ID,true,false)

                    });

                },



/*Original code */


                               jQuery(this).bind("uploadifyComplete", {

                                  'action': settings.onComplete

                                  }, function(event, ID, fileObj, response, data) {

                                  if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) {

                                       jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(' - Completed');

                                       if (settings.removeCompleted) {

                                           jQuery("#" + jQuery(event.target).attr('id') + ID).fadeOut(250,function() {

                                               jQuery(this).remove()

                                               });

                                     }

                                     jQuery("#" + jQuery(event.target).attr('id') + ID).addClass('completed');

                                   }

                               });


/* New code */

 jQuery(this).bind("uploadifyProgress", {

                        'action': settings.onProgress,

                        'toDisplay': settings.displayData

                    }, function(event, ID, fileObj, data) {

                        if (event.data.action(event, ID, fileObj, data) !== false) {

                            jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").animate({

                                'width': data.percentage + '%'

                            },250,function() {

                                if (data.percentage == 100) {

                                    jQuery(this).closest('.uploadifyProgress').fadeOut(250,function() {

                                        jQuery(this).remove()

                                    });

                                }

                            });

                            if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%';

                            if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s';

                            if (event.data.toDisplay == null) displayData = ' ';

                            jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(displayData);

                        }

                    });
+2

Source: https://habr.com/ru/post/1789121/


All Articles