dongliang2058 2010-12-06 12:47
浏览 28
已采纳

来自PHP的Javascript转换响应(自定义错误代码)

Regarding Uploadify

Hello, Currently 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

  • 写回答

1条回答 默认 最新

  • doutuoji8418 2010-12-06 12:55
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题