Response from PHP for Javascript to translate (custom error codes)
Regarding Uploadify
Hello, Currentl开发者_开发百科y I have a PHP only upload script and I'm planning to replace it with Uploadify. My PHP script uploads, checks the file, displays any errors or the download link.
I should be able to do all this by using onAllComplete and onError. But unless I'm missing something I can't see what PHP must output to generate an error for the Javascript to recognize and act upon.
Ideally I'd have the PHP output an error code and then have the Javascript display the error message somewhere. Then if the upload were a success I'd have the PHP output an ID of the file which can be used to display a download link.
Thanks a lot
If I remember correctly. And it might have changed. Uploadify only gets back a 1 or 0 from PHP. So the error might just be that one occurred, not which one.
That said. The Uploadify PHP is like 10 lines long. Just mod it to report error codes if the newer Uploadify does not already.
精彩评论