---
title: "Is there a way to check Fileupload has file or not in client side.If It has i want to enable button"  
description: "Is there a way to check Fileupload has file or not in client side.If It has i want to enable button"  
author: "Nattapong Unaregul"  
published: 2012-07-21  
updated: 2026-05-15  
canonical: https://www.mindstick.com/forum/428/is-there-a-way-to-check-fileupload-has-file-or-not-in-client-side-if-it-has-i-want-to-enable-button  
category: "vb.net"  
tags: ["vb.net"]  
reading_time: 1 minute  

---

# Is there a way to check Fileupload has file or not in client side.If It has i want to enable button

**Here is my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) in default.aspx .The default.aspx is in the [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand) place**<%@ [Page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page) [Language](https://www.mindstick.com/startup/28/preply-the-fast-growing-platform-transforming-language-learning)="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" [title](https://www.mindstick.com/articles/12860/how-to-get-financing-for-salvage-title-cars)="Untitled Page" %><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="[Server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over)"><[table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap)> <tr> <td><asp:[FileUpload](https://www.mindstick.com/forum/2191/fileupload-upload-codebehind) ID="FileUpload1" runat="server" " /></td> <td> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Task cannot be blank" InitialValue="" ControlToValidate="FileUpload1"> </asp:RequiredFieldValidator></td></tr> <tr><td><asp:[Button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) ID="SaveBT" runat="server" [Text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions)="Button" Enable = "False" /></td></tr> </table> \
</asp:Content>\
**\**

## Replies

### Reply by Nattapong Unaregul

Thank for your advice.Here is my solution

```
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">    <asp:FileUpload ID="FileUpload1" runat="server" onchange="FileUpload_OnChange(this,event);"   />  &nbsp; &nbsp; &nbsp;<table>   <tr>  <td> <input type="button" value = "Preview" /></td> </tr>     </table>        <script  language="javascript" type ="text/javascript" >        function Alert(myButton) {            alert(myButton)}            function changeColor(myButton) {            myButton.value = "OK";        }        function FileUpload_OnChange(sender, e) {            document.getElementById('<%=Button1.ClientID %>').disabled = false;        }    </script></asp:Content>
```

### Reply by Anonymous User

Hi Nattapong Unaregul,\
\
Check out the following link it might be resolve your problem.....\
\
https://www.mindstick.com/Articles/331/validating-fileupload-control-for-specific-file-type-and-required-field\
\
https://www.mindstick.com/Articles/176/fileupload-control-in-asp-dot-net\


---

Original Source: https://www.mindstick.com/forum/428/is-there-a-way-to-check-fileupload-has-file-or-not-in-client-side-if-it-has-i-want-to-enable-button

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
