Click here to Skip to main content
15,887,398 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
hi everyone, im really stuck with this one. i have been searching and trying the whole day but nothing helped.
i want to upload a file on my web server !
but i can't figure it out. i'm programming in c#
please help me !
Posted
Comments
Sergey Alexandrovich Kryukov 23-Mar-12 21:52pm    
Not clear what do you mean. Do you want: 1) to develop a Web page where your user can upload the file to your Web site? 2) to upload the file to the host where your site is hosted, as a part of your deployment?
--SA
Ghost_x 24-Mar-12 11:30am    
yes i want to upload the file to the host where my site is hosted..
if would be great if you can help me with the console version..
all i want to do is
1.give path of the file
2.the adress of the server
3.username & password !
and file should be uploaded
Sergey Alexandrovich Kryukov 25-Mar-12 5:01am    
This is not a complete answer to my question. If you do it for deployment, the means of upload are provided by the hosting, and usually this is FTP.
You cannot just upload; you need a Web page already implementing upload; or you need to develop such page. If it exists, you can also programmatically upload. You still did not explained what exactly do you want. If you don't understand it clearly yourself, it's going to be a problem.
--SA
Ghost_x 25-Mar-12 5:40am    
a'right let me try to explain once again.
i have a website ..it has around 1 gb of online storage space available. it supports ftp. i have already made a ftp account.. (i have a username and password).
now i want to upload files(already save on my compute) on that website's online storage space using c#.
now can you help?

I don't know why you are facing so much difficulty in search. A simple google search gives me these:

Uploading Files in ASP.NET 2.0[^]

File Upload with ASP.NET[^]

hope it helps :)
 
Share this answer
 
Comments
Ghost_x 23-Mar-12 14:35pm    
im using windows forms application.
i'm a beginner noob :/
Uday P.Singh 24-Mar-12 11:43am    
then where does web server comes from? you only need web server when you need to run your web application not winform application.
Ghost_x 24-Mar-12 13:14pm    
i just need to upload a file on the my server on which my website is running,
just like we do using Filezilla or anyother ftp managers.
If you have made a window form application and you want to upload a file, you can use ftp managers such as: CuteFTP, Filezilla, TurboFTP, SmartFTP, etc. But If you make Asp website or Asp application or any other web application with visual studio then you can publish (upload) your website and files:
1- Right click on your website or web application name in Visual Studio.
2- Left click on “Publish”.
3- Choose publish method.
4- Enter your server address and credentials.
5- Publish your website.
 
Share this answer
 
Use WebScrapper it currently ready to upload to 22 File host and it already analyzed it for you. If you don't find the file host you want in the WebScrapper package, you can create your own syntax by analyzing the file host's HTML

http://sorainnosia.com/Home/Article/WEBSCRAPPER[^]
 
Share this answer
 
A nice open source C# FTP class - http://ftplib.codeplex.com/[^]
C#
using (FtpConnection ftp = new FtpConnection("ftpserver", "username", "password"))
{        
    ftp.Open(); 
    ftp.Login();
    ftp.SetCurrentDirectory("/images");
    ftp.PutFile(@"c:\myphoto.jpg", "myphoto.jpg"); // upload
}
 
Share this answer
 
v2

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