How to inform a user from upload script that he picture width or height is to big?

Hello,

I've got one problem with SWFUpload. I'm uploading pictures and my php script checks if they have the appropriate dimensions and if not I'd like to inform the user in the SWUpload script that they are to big. In other words: how can I send some kind of message from upload php script to swfupload?

Thanks
ToM

gyphie's picture

serverData

The only way to return data to SWFUpload is to echo it. Then on the browser side SWFUpload will fire the uploadSuccess event. This event receives a 'file' and a 'serverData' parameter.

The serverData parameter will contain all the text content sent back from the server. You can check its contents for an error message.

<?php
echo "THIS IS THE SERVER DATA";
exit();
?>

function uploadSuccess(file, serverData) {
alert(serverData);
}

thx

Thx that helped Smiling