I want my File upload control as read only, so that no one can edit file upload text box. However I could select file using browse button. Write code

This will enable a browse control on your button....let me know if it works!

protected void Browse_Click(object sender, EventArgs e)
        {
            string FileName = "ExporterOutput.txt";
            string FilePath = "C:/Users/My Documents/One.txt"; //change to your location
            System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
            response.ClearContent();
            response.Clear();
            response.ContentType = "text/plain";
            response.AddHeader("Content-Disposition", "attachment; filename = " + FileName + ";");
            response.TransmitFile(FilePath);
            response.Flush();
            response.End();
        }

I didn't understand your requirement. Can you explain again.

How about using already built controls like FileUltimate?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.