上传文件时检查条件 [英] Check Condition While Uploading file

查看:89
本文介绍了上传文件时检查条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi EveryOne,



实际上,我很难在进行文件上传时检查验证。我的要求是我有2个上传控件,如FU1,FU2。 FU1必须填写该信息,因此我需要检查一个条件如果用户点击FU2而没有来自FU1的保存文件需要显示错误消息请从fileupload 1上传文件。从FU1上传文件后,只能从FU2上传文件,该文件也应该在excel文件中。如果那是excel文件那么我们只想保存。

如何做到这一点可以任何人给我一些建议...

Hi EveryOne,

Actually i'm confusing to check validation while doing file upload. My Requirement is i have 2 Upload Controls, like FU1, FU2. FU1 is mandatory to fill that information so i need to check one condition If user click FU2 without save file from FU1 need to display error message " please upload file from fileupload 1". After upload file from FU1 then only able to upload file from FU2, and That file should be in excel file also. If that is excel file then only we want to save.
How to do this can any one give me some suggestion out of this...

推荐答案

您好,



使用下面提到的代码。它将检查所选文件是否已上传。如果没有上传,则无法打开第二个文件上传对话框。



如何在Ajax工具包文件uploadcontrol中检查文件是否存在 [ ^ ]





在此之前添加一个onclickevent到你的第二个文件上传控件说FU2。



whick将会像< br $> b $ b< asp:ajaxfileupload runat =serverid =FU2onclick =return checkAttachments()xmlns:asp =#unknown>





问候

Hsakarp。
Hi,

Use the below mentioned code.It will check whether the selected file has been uploaded or not .If not uploaded it won't open the dialog for second file upload.

How to check file exist or not in Ajax toolkit file uploadcontrol[^]


Before doing that add a onclickevent to your second file upload control say FU2.

whick will be like

<asp:ajaxfileupload runat="server" id="FU2" onclick="return checkAttachments()" xmlns:asp="#unknown">


Regards
Hsakarp.


这篇关于上传文件时检查条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆