Topic: Understanding output in plupload

Hi ! I'm new in plupload.

How can we control the output? I've read this:

You need to add renaming logic to your server-side upload handler (probably upload.php), then package some JSON response with new name, url and whatever else you require and send it back to Plupload, then use FileUploaded event to handle JSON response on client-side. Quite straightforward.

source: http://www.plupload.com/punbb/viewtopic.php?id=708

but I can't find FileUploaded in the API to understand how to code that event, also I can't understand how upload.php works, because if I see it right it only outputs (when verything is OK) this:

die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}');

where is the information there? because the example works great, but I can't understand how the output works.

I was searching a good uploader, and I chose plupload between many options, because I think is the best, but I don't understand anything :S
I think it's very important a better documentation, also some tutorials, or at least a downloable API (for search and fast reading).

Re: Understanding output in plupload

I will explain it better:
Usually I'm debugging my php files with "echo" lines, and see what type and content has my vars, etc.
I can't use upload.php directly, I'm using Kohana, with a lot of modules (like Authentication), I need to adapt the hole upload.php to my code and I need to understand every detail.

If I can echo every line in upload.php then I can see how many times is executed, what is the content, where, etc.

@davit can you help me with this? how can I "echo" every line in upload.php?

Thanks !!

Re: Understanding output in plupload

@enridp check examples section on this site, especially this one: Events. And here is browsable API documentaion as well: API.

Output can be anything, since Plupload doesn't really do anything with it. It just passes it through. Hence it's all up to you what you will pass and how you will handle it in your client side script.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

Re: Understanding output in plupload

2.    Thanks for sharing. I hope it will be helpful to many people that are searching for this topic. Keep posting guys and keep this forum a great place to learn things

Re: Understanding output in plupload

had the same problem,.. fixed it btw big_smile

Re: Understanding output in plupload

davit wrote:

Output can be anything, since Plupload doesn't really do anything with it. It just passes it through. Hence it's all up to you what you will pass and how you will handle it in your client side script.

There must be some processing, since Error events are triggered and defined based off a json response. right?

Re: Understanding output in plupload

@Eric Zimmerman, no - Plupload doesn't process user generated response, json or any other format. Errors that get triggered by Plupload by default are of generic nature - HTTP errors, wrong file format, etc.

If you want to see your issue fixed, do not report it here, do it on - GitHub.