How would i go about making a file host program?

Discussion in 'Programming & Scripting' started by Revvv, Jun 16, 2012.

  1. Revvv Member

    Message Count:
    1,188
    Likes Received:
    89
    Like a program that stores files and when installed on other computers the files can be downloaded?

    just put this together to show you what i mean for it to do(will not look like this is the final program);
    [IMG]
  2. Forgotten Dynasty Phelix loves men.

    Message Count:
    5,629
    Likes Received:
    1,807




    You'll need to link to to some kind of a server, or somewhere where the files are stored.
    Habofro likes this.
  3. Habofro I like computer n' shiz

    Message Count:
    4,559
    Likes Received:
    1,237




    Cant we do that with .net frame?
  4. Forgotten Dynasty Phelix loves men.

    Message Count:
    5,629
    Likes Received:
    1,807




    I don't know very much about .Net
  5. Habofro I like computer n' shiz

    Message Count:
    4,559
    Likes Received:
    1,237




    Me neither, but from what i read, net frame can do that :)
  6. Yes Banned

    Message Count:
    170
    Likes Received:
    13
    Yes you can. Read about System.Net.Sockets.
  7. amd42 Experienced Member

    Message Count:
    577
    Likes Received:
    344
    While you could use that, System.Net.WebClient would be better suited for this as it already has a DownloadFile method. You just need to upload the files to a server or file host that supports hotlinking.
  8. ActionScript XG R4PiDzZ

    Message Count:
    2,436
    Likes Received:
    730




    You'll need;
    • Server (FTP access for uploading, and permissions for downloading)
    • App (uploads using FTP credentials, and downloads from file location)
    Like amd42 said, use WebClient. You'll probably want to run the async file download function.
  9. Zaid Getting There

    Message Count:
    388
    Likes Received:
    44
    Code:
                string FtpServer = "ftp.example.com";
                string FtpUsername = "exampleusername";
                string FtpPassword = "password";
                string FileName = "Lol.exe";
     
                WebClient Client = new WebClient();
     
                NetworkCredential FtpCredential = new NetworkCredential(FtpUsername, FtpPassword);
     
                Client.Credentials = FtpCredential;
              
                Client.DownloadFile(FtpServer, FileName);
     
                //Upload A File
                Client.UploadFile(FtpServer + "\\" + FileName, "C:\\textfile.txt");
    
    Just like XG R4PiDzZ said, you will need to get an Ftp account.
  10. Yes Banned

    Message Count:
    170
    Likes Received:
    13
    ... he didn't mention anything about using a webserver ... >_>

    ftp is completely unnecessary for something this simple

    err actually, now that I re-read the OP, it sounds like your making an AIO-like program, which requires no networking. Is that what you're doing?
  11. Revvv Member

    Message Count:
    1,188
    Likes Received:
    89
    Couldnt I just use mediafire? thats a cloud service..
  12. ActionScript XG R4PiDzZ

    Message Count:
    2,436
    Likes Received:
    730




    Yeah, Mediafire will work fine if you just want to download. Uploading to Mediafire may cause a problem, as I don't believe there is a public API. That's why I recommended using a your own server.
  13. Revvv Member

    Message Count:
    1,188
    Likes Received:
    89
    how would i go about making the program with mediafire and you have to pay to get a server which im not wanting to do
  14. itzjesus Getting There

    Message Count:
    54
    Likes Received:
    16
    Just use 000webhost if this is a temporary program, and just upload it. Then you could just put 3 web browsers in your form hidden then set link to the link of each program, to the button.
    then click button 1 and put Webbrowser1.Navigate("www.myhostname.com/file")
    And it should work.:p
    Haven't programmed in like 4 years so I'm not sure if that is right;/
  15. Revvv Member

    Message Count:
    1,188
    Likes Received:
    89
    no those files where an example..i want to be able to upload files from the program and download them..
  16. FiireModz Newbie

    Message Count:
    43
    Likes Received:
    0
    You can use any web host you want use the code listed above and just swap out the ftp to your webhost my favorite is weebly because you upload and mange only your files not a hugr networking site like mediafire i will put atut up soon since im making my own assistant for my team/staff!
    Code:
    string FtpServer = "ftp.example.com";
                string FtpUsername = "exampleusername";
                string FtpPassword = "password";
                string FileName = "Lol.exe";
     
                WebClient Client = new WebClient();
     
                NetworkCredential FtpCredential = new NetworkCredential(FtpUsername, FtpPassword);
     
                Client.Credentials = FtpCredential;
             
                Client.DownloadFile(FtpServer, FileName);
     
                //Upload A File
                Client.UploadFile(FtpServer + "\\" + FileName, "C:\\textfile.txt");
  17. FiireModz Newbie

    Message Count:
    43
    Likes Received:
    0
    Code:
    Use a FTP Client Only way try using x10host.com
  18. amd42 Experienced Member

    Message Count:
    577
    Likes Received:
    344
    Making an FTP client is not the only way of doing this. In fact, I would recommend against it if possible. Doing so would require that you leave the password in your program somewhere. This means that if someone disassembles the program or sniffs the packets it sends out, then he would be able to obtain the login information and have complete access to the FTP server. Who knows what could happen then.

    A more secure way of making a file host would be to route all uploads and downloads through a PHP script (the x10host.com site that FiireModz linked to supposedly supports PHP). This would prevent people from having complete access to your server (assuming that there are no security issues in your PHP script) and would also be a lot more flexible in the long run - for example, you could track upload and download stats, impose limits on how many files someone can upload, or set up a user account and private storage system.

    For more information on making PHP scripts to do this, you can check out this tutorial that I found or search around on Google: http://net.tutsplus.com/tutorials/php/online-file-storage-with-php/
    godzcheater likes this.
  19. FiireModz Newbie

    Message Count:
    43
    Likes Received:
    0
    Nice thank you very informative! This guy here knows it Revvv listen to him!