Click here to Skip to main content
15,916,945 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi

i need To upload Files without using textbox . When i click the upload button the the users can select any files from desktop or any drives .
Posted
Updated 16-Sep-11 5:38am
v2

1 solution

Hi,

Yeah we can do that.If we use javascript that is possible.

just place this code in your page...

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language ="javascript" >
        function f1() {
            $("#fileup1").click();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
    </asp:scriptmanager>
      <input type ="button" value ="put" onclick="f1()" />
      <input type="file" id="fileup1" style =" visibility :hidden ;"/>
     
    
    </form>
</body>
</html>



I hope it can works for you also

All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900