Click here to Skip to main content
11,631,212 members (69,430 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 23-Mar-12 6:08am
Ghost_x586
Comments
SAKryukov at 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 at 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
SAKryukov at 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 at 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?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 Smile | :)
  Permalink  
Comments
Ghost_x at 23-Mar-12 14:35pm
   
im using windows forms application.
i'm a beginner noob :/
Uday P.Singh at 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 at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


Advertise | Privacy | Mobile
Web01 | 2.8.150723.1 | Last Updated 20 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100