473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

File upload as ASP.Net control??

I need to upload two files, one at a time. The only file control I can
find uses the <input type="file" />, so the handling code has to go in
the HTML side and not the code behind. I would much rather code this in
the proper place for good practice. Is there an ASP.Net control for
file upload (the <asp: /> tagged controls)? Or do I have to do this the
ugly way??

Thanks.
Nov 19 '05 #1
3 1072
You can still use the HtmlInputFile control from code behind, just
make sure it has an ID and runat="server" is set.
http://msdn.microsoft.com/library/de...ileControl.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 31 Jan 2005 00:13:01 GMT, No one <no***@yahoo.com> wrote:
I need to upload two files, one at a time. The only file control I can
find uses the <input type="file" />, so the handling code has to go in
the HTML side and not the code behind. I would much rather code this in
the proper place for good practice. Is there an ASP.Net control for
file upload (the <asp: /> tagged controls)? Or do I have to do this the
ugly way??

Thanks.


Nov 19 '05 #2
Thanks....now if only I could stuff this file into an MS SQL database directly.

Scott Allen wrote:
You can still use the HtmlInputFile control from code behind, just
make sure it has an ID and runat="server" is set.

http://msdn.microsoft.com/library/de...ileControl.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 31 Jan 2005 00:13:01 GMT, No one <no***@yahoo.com> wrote:
I need to upload two files, one at a time. The only file control I can
find uses the <input type="file" />, so the handling code has to go in
the HTML side and not the code behind. I would much rather code this in
the proper place for good practice. Is there an ASP.Net control for
file upload (the <asp: /> tagged controls)? Or do I have to do this the
ugly way??

Thanks.


Nov 19 '05 #3
> Thanks....now if only I could stuff this file into an MS SQL database
directly.
You can, but whether you should or not is a question to consider. Storing a
file in a database entails extra expense when working with the file, as it
must first be stored in the database, which can be expensive, depending upon
the size of the file, and be fetched in binary form from the database, which
involves a good hit to the database, and then turned back into a file or
file stream. Generally, references to files (names or paths) should be
stored in a database, and the files themselves in the file system.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"no one" <no***@yahoo.com> wrote in message
news:41**************@yahoo.com... Thanks....now if only I could stuff this file into an MS SQL database
directly.

Scott Allen wrote:
You can still use the HtmlInputFile control from code behind, just
make sure it has an ID and runat="server" is set.

http://msdn.microsoft.com/library/de...ileControl.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 31 Jan 2005 00:13:01 GMT, No one <no***@yahoo.com> wrote:
>I need to upload two files, one at a time. The only file control I can
>find uses the <input type="file" />, so the handling code has to go in
>the HTML side and not the code behind. I would much rather code this in
>the proper place for good practice. Is there an ASP.Net control for
>file upload (the <asp: /> tagged controls)? Or do I have to do this the
>ugly way??
>
>Thanks.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
1
by: TK | last post by:
I have a file upload control to allow a user to select/upload a file to the server. They need to upload x number of files in one shot because they have to confirm that they are uploading x number...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
by: George Durzi | last post by:
Anyone know of a good file upload control? I don't like using the built in one because it's unable to maintain state on a refresh. Thanks!
3
by: Bijoy Naick | last post by:
I've written a simple file upload user control in VB .NET. It comprises of an InputFile HTML Server Control, an Upload button and a message label. User clicks on the Browse button of the...
3
by: Sarav | last post by:
Hi All, I need to upload an XML file via an client side ActiveX control. I searched the web but everywhere got the samples of using file control alone. How can I upload a file into my web server...
12
by: GuangXiN | last post by:
I want the file upload element disappear, instead of it, I place a text box and a button with my own css defination. but it doesn't work on IE7. What should I do now? <form action="upload.php"...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.