Hi everyone,
I am developing an web-database application using ASP.NET, C# and sql server 2000 .
In the application i want to upload different scanned files (pdf,doc,excel,jpeg,ttf,etc) onto the database.. how can i carry out this task :-?
If any one got the solution.. then, please let me know...
thanks in advance
Step 1: Use the ASP.NET file input control to let the user select a file. This is in the HTML section of the toolbox.
Step 2: Make sure that the is set correctly to support file uploads. This means settings its encType to multipart/form-data.
Step 3: Read the file details on the server side code from the Page.Request.Files property.
Step 4: From here you can then save the files to disk and just add an index to them in the database, or you can save their contents into the DB itself (as BLOBs).
Hope this helps.|||
Hey thanx man..
Will try it out.. and if any probs will ask for ur help
|||
Hi,
It really helped me.. but can u plz repeat the 2nd step.. coz.. theres a bit confusion reading that :(
|||In order to allow the uploading of files, you need to set the encType property of your form element.Open the .aspx file in HTML view, locate the element and add
encType="multipart/form-data" inside the element.
e.g.
Essentially, this allows you to upload a combination of files and form variables.
Hope this helps.|||
Hey thanx U soo much man..
well i gonna try out this and will definitely tell u the out-put of the same.
Thanx again, and keep the good work going
|||
Hi,
I couldnt add the encType="multipart/form-data" into the file input :(
when i tried adding it to the input tag of the file, it gave an parse error,,
So, plz let me know the soln..
<form id="Form1" method="post" runat="server">
<asp:Label id="Label2" style="Z-INDEX: 102; LEFT: 386px; POSITION: absolute; TOP: 106px" runat="server"
ForeColor="Maroon" Font-Size="Medium" Font-Bold="True" Width="265px">Uploading new Employee Details</asp:Label><INPUT style="Z-INDEX: 121; LEFT: 494px; POSITION: absolute; TOP: 431px" type="file" id="File1" name="File1" runat="server">
I tried adding it in the input tag, but encountered an parse error,hope i will get the soln,,
thanks in advance
No comments:
Post a Comment