duanju8308 2010-05-04 02:35
浏览 19

如果用户无法下载文件,如何显示对话框

dealing with php/html/javascript.

i'm trying to figure out a good/best approach to allowing a user to download a file. i can have the traditional href link, that interfaces with the back end php app to download the file.

however, i want to have the app display some sort of dialog/alert if the user isn't able (basedon acl/permissions) to download the file... does this have to ba an ajax thing, as i don't want to do a page refresh...

thoughts/comments/pointers to code samples are appreciated.

thanks.

-tom

hi... more data/information.

in my test, i send the userID/fileID via the query to the backend php.

the app then confirms the user is the user for the file, and that the user has the rights to access the file. the query data is matched against data in the db for the user/file combination.

so the last/critical check occurs on the back end.

hope this gives a bit more insight into what i'm looking to do/accomplish.

thanks

-tom

  • 写回答

2条回答 默认 最新

  • duanbanfei2875 2010-05-04 02:37
    关注

    AJAX could be a good technology to use if your looking for a work-around for the page not refreshing but it doesn't have to be your only option.

    Another option without requiring AJAX, which might be cumbersome depending on how your project is design, is to enable or disable features depending on the user's authentication level.

    As a simple example, enable features only related to Administrators and disable Administrator features for normal users.

    You don't necessarily have to enable/disable features, you could also decide before the user clicks on links whether or not he/she has rights to do-so.

    With more information on how your project is laid out, we can provide more concise answers.

    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源