Hi to everyone.
I'm using in a site the v1.0.2 Plugin Demo, with a lot of modifications in call back's for our purpouse. Our "most wanted" feature is to get server errors, in order to do or not to do the uploads. I've readed the documentation wich gave me the information the flash 9 version of swfupload does the job, but the plugin uses version 8. I've tried to change the code to version 9, but the files aren't uploaded, none of them.
Is there a way to use v1.0.2 Plugin Demo with flash 9? To get the server error's is highly important to us.
Configs used in our page (we are at Brazil, so the messages are in portuguese):
/**** CONFIGS SWF UPLOAD ****/
var swfu;
window.onload = function() {
// Max settings
swfu = new SWFUpload({
upload_script : "http://localhost/sigmav2/start.lua?control=document&act=send",
target : "SWFUploadTarget",
flash_path : "lib/SWFupload/swfupload_f8.swf",
file_post_name: "arquivo",
allowed_filesize : 614400, // 600 MB
allowed_filetypes : "*.*",
allowed_filetypes_description : "Todos os arquivos...",
browse_link_innerhtml : "Selecionar documentos",
upload_link_innerhtml : "Enviar documentos",
browse_link_class : "swfuploadbtn browsebtn",
upload_link_class : "swfuploadbtn uploadbtn",
upload_file_queued_callback : fileQueued,
upload_file_start_callback : uploadFileStart,
fire_before_start_upload: before_upload,
upload_progress_callback : uploadProgress,
upload_file_complete_callback : uploadFileComplete,
upload_file_cancel_callback : uploadFileCancelled,
upload_queue_complete_callback : uploadQueueComplete,
upload_file_error_callback : uploadError,
upload_file_cancel_callback : uploadFileCancelled,
auto_upload : false,
debug : true
});
};
The call back's (you can see a lot of changes here, also messages are in portuguese):
var totalCanceledFiles = 0;
var totalQueueFiles = 0;
function fileQueued(file, queuelength) {
totalQueueFiles = queuelength;
var listingfiles = document.getElementById("SWFUploadFileListingFiles");
if (!listingfiles.getElementsByTagName("ul")[0]) {
var info = document.createElement("h4");
info.appendChild(document.createTextNode("Fila de documentos"));
listingfiles.appendChild(info);
var ul = document.createElement("ul");
listingfiles.appendChild(ul);
}
listingfiles = listingfiles.getElementsByTagName("ul")[0];
var li = document.createElement("li");
li.id = file.id;
li.className = "SWFUploadFileItem";
var singleForm = document.getElementById("singleForm").innerHTML
singleForm = singleForm.replace(/#FILEID#/g,file.id)
li.innerHTML = "<b>Arquivo: </b>"+file.name +"<br/>"+ singleForm +"<span class='progressBar' id='" + file.id + "progress'></span><a id='" + file.id + "deletebtn' class='cancelbtn' href='javascript:swfu.cancelFile(\"" + file.id + "\");'><!-- IE --></a>";
listingfiles.appendChild(li);
var queueinfo = document.getElementById("queueinfo");
queueinfo.innerHTML = queuelength + " documento(s) na fila";
document.getElementById(swfu.movieName + "UploadBtn").style.display = "block";
document.getElementById("cancelqueuebtn").style.display = "block";
var x=document.getElementById("documentClassID");
var license = x.options[x.selectedIndex].value;
if(license==1 || license==2 || license==3)
Element.show('licenseDetails_'+file.id);
else
Element.hide('licenseDetails_'+file.id);
}
function uploadFileCancelled(file, queuelength) {
totalQueueFiles = queuelength;
var li = document.getElementById(file.id);
li.innerHTML = file.name + " - cancelado";
li.className = "SWFUploadFileItem uploadCancelled";
var queueinfo = document.getElementById("queueinfo");
queueinfo.innerHTML = queuelength + " documentos na fila";
totalCanceledFiles += 1;
}
function before_upload(current_file_number,total_files){
var msg = verifyMultiDoc();
var now = new Date();
today = now.format("yyyymmdd")
for(i=0;i<total_files+totalCanceledFiles;i++)
{
var description = $("description_SWFUpload_0_"+i);
var created_at = $("created_at_SWFUpload_0_"+i);
var doc_license_number = $('doc_license_number_SWFUpload_0_'+i)
var type_license_days = $("type_license_days_SWFUpload_0_"+i);
var type_license_date = $("type_license_date_SWFUpload_0_"+i);
var license_date = $("license_date_SWFUpload_0_"+i);
if((description && created_at && doc_license_number) && (!description.value || !created_at.value || !doc_license_number.value) )
{
msg += "Existem campos não preenchidos no "+(i+1)+"º elemento da fila\n";
}else
{
if(created_at && created_at.value && !checkdate(created_at.value))
{
msg += "A data do documento no "+(i+1)+"º elemento da fila é inválida\n";
}
}
/* license validation */
if($('existsLicenseNumber').value==1)
{
if(!type_license_days.checked && !type_license_date.checked)
{
msg += 'No '+(i+1)+'º elemento da fila escolha se a validade da licença será em dias ou por data\n';
}
else
{
if(type_license_days.checked) //License in days
{
if(license_date.value=="")
{
msg += 'No '+(i+1)+'º elemento da fila preencha a validade da licença\n';
}
else
{
if(isNaN(license_date.value))
{
msg += 'No '+(i+1)+'º elemento da fila a validade da licença está incorreta\n';
}
}
}
else //license in date
{
if(license_date.value=="")
{
msg += 'No '+(i+1)+'º elemento da fila preencha a validade da licença\n';
}
else
{
if(!checkdate(license_date.value))
{
msg += 'No '+(i+1)+'º elemento da fila a data da validade da licença é inválida\n';
}
else
{
arrLicDate = license_date.value.split("/");
docLicInt = parseInt(arrLicDate[2] + arrLicDate[1] + arrLicDate[0]);
if(docLicInt < today)
{
msg += 'No '+(i+1)+'º elemento da fila a validade da licença deve ser maior que a data atual\n';
}
}
}
}
}
}
}
if(msg)
{
alert(msg);
return false;
}
return true;
}
function uploadFileStart(file, position, queuelength) {
var description = document.getElementById("description_"+file.id);
var created_at = document.getElementById("created_at_"+file.id);
var doc_license_number = document.getElementById("doc_license_number_"+file.id);
var type_license_date = document.getElementById("type_license_date_"+file.id)
var type_license_days = document.getElementById("type_license_days_"+file.id)
var type_license = type_license_date.value || type_license_days.value;
var license_date = document.getElementById("license_date_"+file.id);
this.addFileParam(file.id,"description", description.value);
this.addFileParam(file.id,"createdAt", created_at.value);
this.addFileParam(file.id,"docLicenseNumber", doc_license_number.value);
this.addFileParam(file.id,"licenseDate", license_date.value);
this.addFileParam(file.id,"docLicenseDate", type_license);
var jsonFormData = Form.serialize('form',true);
for (var j in jsonFormData)
{
this.addPostParam(j, jsonFormData[j]);
}
var div = document.getElementById("queueinfo");
div.innerHTML = "Enviando documento " + position + " de " + queuelength;
var li = document.getElementById(file.id);
li.className += " fileUploading";
description.disabled = true;
created_at.disabled = true;
doc_license_number.disabled = true;
license_date.disabled = true;
type_license_date.disabled= true;
type_license_days.disabled= true;
}
function uploadProgress(file, bytesLoaded) {
var progress = document.getElementById(file.id + "progress");
var percent = Math.ceil((bytesLoaded / file.size) * 260);
progress.style.backgroundPosition = "-" + (260 - percent) + "px 0px";
}
function uploadError(errno) {
// SWFUpload.debug(errno);
}
function uploadFileComplete(file) {
var li = document.getElementById(file.id);
li.className = "SWFUploadFileItem uploadCompleted";
}
function cancelQueue() {
swfu.cancelQueue();
document.getElementById(swfu.movieName + "UploadBtn").style.display = "none";
document.getElementById("cancelqueuebtn").style.display = "none";
}
function uploadQueueComplete(file) {
var div = document.getElementById("queueinfo");
//div.innerHTML = "Todos os arquivos foram enviados..."
document.getElementById("cancelqueuebtn").style.display = "none";
Since now i thank for every reply. 
Flash Player 9 version
I tested using swfupload_f9.swf in the v102 Demo and the only change I had to make was to make sure that the upload.php script returned some content.
You MUST return content from upload.php when using the Flash 9 version.
Just adding something like: echo "UPLOAD"; at the beginning should work.
And, even though v102 didn't support the serverData parameter it will still be sent to the uploadFileComplete by the v102 plugin.
It works, but...
I changed my code here to get the parameters via POST, not GET as it was before and i'm writing just a line of content just before my upload code and now the upload works. Thanks for your patience.
But now I have another problem: large files are not uploaded properly. Less then 100Mb goes fine, but above, nothing. My application is configured to allow 600Mb of input data and the default timeout is 90 seconds (uploading 250Mb takes less than half this time, wich is an appropriate timeout). I'm testing in both IE and FF and the same problem, the address bar went until the end, the box turn into green but the file is not there.
What am I doing wrong this time?...
Server config
Almost always this is a server configuration issue. Check both your web server configuration and your application server configuration (e.g, Apache and PHP). Usually timeouts aren't an issue because script execution doesn't normally start until after the file has been updated but I still usually extend them out to normal upload times.
Alternately, it could be a client software firewall/anti-virus issue, file system quota issue, or you could be the first to hit Flash's Officially supported 100 MB limit (although I don't think this is really a limit just the officially supported upload size).
Any SWFUpload file_size_limit setting issues would trigger when the file is queued rather than what it is uploaded.
You might do a packet capture to see what content the server is returning after the upload is complete.