0

I'm using uploadifive (non-flash version of uploadify), for uploading with jquery and php

I'm looking for ways to treat what is being returned (echo'ed) from uploadifive.php, same way as errors/results are shown by jquery on each file queue element

 'onUploadComplete (or maybe onProgress)' : function(file, data) {
 // show the php result/error at the queue element
 }

As it is now, it says "Completed" for the file no matter what php returns

I'm thinking, I should fiddle around with the uploadifive.js file.. but where excactly and how?

2 Answers 2

2

I have just had the same problem and found that "file.xhr.responseText" will output the content echoed by the backend script.

Good Luck!

Sign up to request clarification or add additional context in comments.

3 Comments

Yes, I discovered that too by investigating the script ;) Thanks
How exactly is this the correct solution? I'm encountering the same problem but I don't know how to fix it.
This is solution with "file.xhr.responseText" and this definitively save my day - Thanks! uploadify.com/forum/#/discussion/9139/…
0

You can access the data echoed in the script in the data variable… Then you can handle it as you want :

For instance, if everything is ok I don't echo anything, but if something wrong happens (file too big, bad format …) I echo the message in my php script and then

'onUploadComplete': function (file, data) {
                    $('#uplodifive_errors').append('<div class="alert alert-error alert-dismissable">File "' + file['name'] + '" : ' + data + '</div>');
                },

I show it in a error div.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.