mIRC Home    About    Download    Register    News    Help

Print Thread
upload file to ftp with trigger #136604 30/11/05 06:54 PM
Joined: Apr 2005
Posts: 72
B
bodo0815 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
hello
is it possible to upload a file with a trigger???
e.g.: on *:text:!stats:#: { upload......stats.txt }
if yes... how?

Re: upload file to ftp with trigger #136605 30/11/05 07:44 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I'm not too sure if this works because I don't have an FTP account so..
This is using Mavric-'s (Using FTP through mIRC without sockets.) tutorial. smile

Code:
On *:Text:!upload &:*: {
  if ($isfile($2)) {
    if (!$isfile(batch.bat)) {
      var %bat = write batch.bat
      %bat @echo off
      %bat -i -s:ftp.txt
      %bat exit
    }
    var %ftp = write ftp.txt
    %ftp ftp
    %ftp open your.ftp.server
    %ftp YourUsername
    %ftp YourPassword
    %ftp PUT $2
    %ftp QUIT
    run batch.bat
  }
}


-Andy

Re: upload file to ftp with trigger #136606 30/11/05 09:26 PM
Joined: Apr 2005
Posts: 72
B
bodo0815 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
hmm
now i have this:
ftp.bat:
@echo off
ftp -i -s:ftp.txt
exit

ftp.txt:
ftp
open myftp.com
myusername
mypass
test/test
put D:\Local_WEB\stats.html
quit

alias:
Code:
alias transfer {
  var %textfile = C:\test\ftp.txt
  run C:\test\ftp.bat
}


on /transfer a windows open and close
but the file "stats.html" is not on FTP :-(

Last edited by bodo0815; 30/11/05 09:26 PM.
Re: upload file to ftp with trigger #136607 30/11/05 11:03 PM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
Hmm... I was interested in this as well and tried the above mentioned tutorial. However I ran into some problems with it. The file doesn't exactly upload. It creates the file on the ftp but it's completely blank file (0kb). So I searched mircscripts and found this, which works great:

http://www.mircscripts.org/comments.php?cid=2520

Re: upload file to ftp with trigger #136608 01/12/05 12:02 AM
Joined: Apr 2005
Posts: 72
B
bodo0815 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2005
Posts: 72
it works fine thx :-)
...but how can i upload files to a specific path?
e.g.: root/html/test

Re: upload file to ftp with trigger #136609 01/12/05 12:29 AM
Joined: Aug 2005
Posts: 525
S
schaefer31 Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
In the remote path put "/root/html/test/your-file"