Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# HTML HTTP
I'm trying to make an auto uploader to websites with C#
For instance, I'm trying to create an auto uploader for websites like http://www.fileflyer.com/default.aspx, http://multiupload.com, shareflare, letitbit etc...
The website asks the user to check the "I agree to Terms of Service" and asks him to enter an email.
 
P.S I searched the internet a bit and I found this[^].
However, it did not work with multiupload and fileflyer (which are fundamental for me to accomplish this).
Can anyone give me a small example or some info about that? an example would be perfect
Thanks from advance, Adam.
Posted 3-Jun-12 3:55am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

you have to look up for API in your target sites, a web service maybe!
then include it in your projects, and then read their documents to config!
but if you want just upload file to server use this code snippet:
private void SaveTToWeb()
{
    try
    {
        //create WebClient object
        WebClient client = new WebClient();
        string myFile = @"C:\file.txt";
        client.Credentials = CredentialCache.DefaultCredentials;
        client.UploadFile(@"http://myweb.com/projects/idl/Draft Results/RK/myFile", "PUT", myFile);
        client.Dispose();
    }
    catch (Exception err)
    {
        MessageBox.Show(err.Message);
    }
}
and if you want to use ftp, read this:
C# ftp upload[^]
  Permalink  
Comments
sahabiswarup at 13-Feb-13 1:53am
   
i've tried your code but getting an error
“The remote server returned an error: (405) Method Not Allowed.”
 
can you please help me to get out of this?
taha bahrami at 24-Mar-13 8:24am
   
All 405 errors can be traced to configuration of the Web server and security governing access to the content of the Web site.
check if you have the permission to access that root on your server!

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

  Print Answers RSS
0 OriginalGriff 404
1 Sergey Alexandrovich Kryukov 387
2 Shemeemsha RA 148
3 Abdul Samad KP 125
4 CPallini 100
0 OriginalGriff 6,189
1 Sergey Alexandrovich Kryukov 5,666
2 CPallini 4,810
3 George Jonsson 3,429
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 3 Jun 2012
Copyright © CodeProject, 1999-2014
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