Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Save doc file in Asp

Author  Topic 

messi
Starting Member

47 Posts

Posted - 2008-09-22 : 16:47:36
I want to make a web page
which can upload doc file to my site

like this:



afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-22 : 17:13:56
Use the file upload control in the standard toolbox in Vstudio
Go to Top of Page

messi
Starting Member

47 Posts

Posted - 2008-09-22 : 18:27:23
Thanks i will try and tell you
Go to Top of Page

messi
Starting Member

47 Posts

Posted - 2008-09-22 : 18:45:00
Yes , i found file upload in toolbox
but it`s like that :



there is no upload button ????

Am i going to make it or what ?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-22 : 21:56:50
Yes, thats correct. YOu have to add an upload button and add your code behind on button1_click event.

Also for uploads you have to use the FileUpload control. e.g.

<asp:FileUpload ID ="Uploader" runat="server"/>

Also make sure you have the using System.IO; namespace declared

Go to Top of Page

messi
Starting Member

47 Posts

Posted - 2008-09-23 : 04:37:28
OK
e.g: if i want to upload afrika.doc
what are the steps ? plz explain
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-23 : 04:43:31
When you add your button, in your code behind you write your upload event, which will fall under the button1_click event.

when the user clicks on browse, the browse dialog box appears.

- He selects a file and click ok
- He then clicks upload

...This fires the button1_click event, which will be the upload script written by you
Go to Top of Page

messi
Starting Member

47 Posts

Posted - 2008-09-23 : 08:52:38
This is the big problem afrika
'upload script written by you'

what i will write in button1_click event.???
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-09-23 : 08:57:22
http://www.4guysfromrolla.com/webtech/LearnMore/Upload.asp

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-23 : 10:59:21
quote:
Originally posted by messi

This is the big problem afrika
'upload script written by you'

what i will write in button1_click event.???



I built a custom upload control using java script and ajax, to allow multiple file uploads.

There is a brilliant example in the book ASP.NET 3.5 in C# 2008, from novice to professional, by Mathew MacDonald, in page 642 - 645.

I am not sure if i can paste it due to copy right protection.
Go to Top of Page

messi
Starting Member

47 Posts

Posted - 2008-09-23 : 14:43:02
jsmith8858 thanks for your link ,but i hardily understand
and thank you afrika but,how i can get this book.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-23 : 15:30:40
I bought mine on amazon.co.uk early in the year. But it seems a newer edition is out.

http://www.amazon.co.uk/s/ref=nb_ss_w_h_/202-6460922-0883813?url=search-alias%3Dstripbooks&field-keywords=ASP.NET+3.5+in+C%23+2008&x=12&y=17

I would recommend begnining to professional
Go to Top of Page
   

- Advertisement -