• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload files to FTP server
Sending files to an FTP server, you can use your PC to send logs to a computer with the VPS.
PHP Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;
using Addon;

    public class 
Class1 CPlugin
override void OnServerLoad()
filename "plugins//log.txt";
string ftpServerIP "";
string ftpUserID "admin";
string ftpPassword "12345";
string ftpPath "/public_html/";
FileInfo fileInf = new FileInfo(filename);
string uri "ftp://" ftpServerIP ftpPath fileInf.Name;
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" ftpServerIP ftpPath fileInf.Name));
reqFTP.Credentials = new NetworkCredential(ftpUserIDftpPassword);
reqFTP.KeepAlive false;
reqFTP.Method WebRequestMethods.Ftp.UploadFile;
reqFTP.UseBinary true;
reqFTP.ContentLength fileInf.Length;
int buffLength 2048;
byte[] buff = new byte[buffLength];
int contentLen;
FileStream fs fileInf.OpenRead();
Stream strm reqFTP.GetRequestStream();
contentLen fs.Read(buff0buffLength);
                while (
contentLen != 0)
contentLen fs.Read(buff0buffLength);
            catch (
Exception ex)
ServerPrint("[FTP Status]: " ex.Message);

(01-27-2016, 20:17)S3VDIT0 Wrote: I think everyone realized Why is it necessary

I don't.
(01-28-2016, 09:03)SuperNovaAO Wrote:
(01-27-2016, 20:17)S3VDIT0 Wrote: I think everyone realized Why is it necessary

I don't.

Oh sorry =)
I'm in a hurry and could not explain.
This script I made of the need to send server logs to my FTP server, just when I am on the VPS I dig into folders server lag, as well as my PC quickly send logs or complaints about the players...
(01-28-2016, 16:50)zhorakrnev Wrote: Зачем?

Короче, серв на VPS хостинге, когда я роюсь в папках чтобы найти жалобы или логи сервера, тот ппц как лагает! А со сбросом через FTP на мой ПК(с запущенным FTP сервером) это не трабла, лагов нет я счастлив =)

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help, server Admin largosik 0 862 02-02-2019, 18:09
Last Post: largosik
  Add a point shop to my server h1dexyz 1 1,351 03-04-2018, 22:36
Last Post: h1dexyz
  [Release] MW3 Server Addon Extensions master131 212 68,816 04-09-2017, 23:31
Last Post: huhu
Lightbulb Preview ^6(euroinfected)^2beginning all cfg FILES groochu1982 1 1,501 02-26-2017, 08:37
Last Post: tiraga
Lightbulb Preview ^1KmA^2HC TDM all cfg Files groochu1982 0 1,024 02-19-2017, 10:12
Last Post: groochu1982
Lightbulb Preview Weapon Classe For Infected Clasic Server groochu1982 0 1,172 02-19-2017, 08:35
Last Post: groochu1982
Exclamation Help HOW CAN I TURN OFF THE "CROSSHAIR" IN MY SERVER? Eliichong0 0 1,239 06-16-2016, 16:01
Last Post: Eliichong0

Forum Jump:

Users browsing this thread: 1 Guest(s)