Hi
I'm trying to dynamically change the upload url and it's failing with the following error in the callFlash method
swfu.setUploadUrl("/new-url");
__flash__argumentsToXML not defined
I get the same problem with
swfu.addPostParam("id","1");
This is happening on Windows XP, Safari 4.04, Firefox 3.5.8, IE
The uploader works fine if I don't try to change the upload url
I'm using 2.1 of SWFUpload
February 24, 2010 - 6:36am
Here is some more details on the configuration of SWFUpload
window.onload = function () {
var settings = {
minimum_flash_version: "9.0.28",
upload_url : "/flash-upload-image.html",
flash_url : "/flash/swfupload.swf",
file_size_limit : "3 MB",
file_upload_limit : 20,
file_queue_limit : 0,
file_types : "*.jpg;*.jpeg;*.gif;*.png",
file_types_description : "JPG, JPEG, GIF and PNG Images",
file_post_name : "file",
post_params : { "cookieString": document.cookie },
// Event Handlers
file_dialog_complete_handler : ImageUpload.fileDialogComplete,
file_queued_handler : ImageUpload.fileQueued,
upload_complete_handler : ImageUpload.uploadComplete,
upload_success_handler : ImageUpload.uploadSuccess,
upload_progress_handler : ImageUpload.uploadProgress,
upload_error_handler : ImageUpload.uploadError,
file_queue_error_handler : ImageUpload.fileQueueError,
swfupload_pre_load_handler: ImageUpload.flashDetected,
swfupload_load_failed_handler: ImageUpload.flashNotDetected,
button_image_url: "/images/gallery_upload.png",
button_width: "175",button_height: "23",
button_placeholder_id : "flash_upload",
button_width: 175,
button_height: 23,
button_text : 'Choose Photos (3MB max)',
button_text_style : '.swf-btn { font-family: Arial; font-size: 12px; font-weight: bold; color: #ffffff; } .sm{ font-size: 9px; }',
button_text_top_padding: 1,
button_text_left_padding: 18,
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
debug: true
};
settings.upload_url="/flash-upload-image.html;
var swfu = new SWFUpload(settings);
swfu.addPostParam("id","1");
addPostParam does not work in this case for me in this case also with the same error message
I have read that I need to import some flash external interfaces?
March 5, 2010 - 12:11pm
I have no idea what's wrong, but i worked around the problem by adding parameter in update_start_handler
I think the value property needs to be a string as well
var settings = {
....
upload_start_handler :ImageUpload.uploadStart,
....
}
....
uploadStart: function(file) {
swfu.addPostParam("id","1");
},
....
March 5, 2010 - 4:33pm
You cannot change SWFupload settings immediately after you all new SWFUpload();
You need to use the swfUploadLoaded event (swfupload_loaded_handler setting) to know when SWFUpload has loaded and is ready (it takes a moment for the SWF to load and the browser to initialize it).
In your swfUploadLoaded event and thereafter (in other events) you can start changing things.