Go Back   FlashFXP Forums > > > >

! Requests Need a script or some sort of cool .bat file ? Ask here!

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-08-2009, 01:23 AM   #1
yixin
Junior Member
 
Join Date: Jul 2009
Posts: 4
Default Communication with C/C++ program

I`m in a software project in which we will use FTP server.
In this project we want the server send my C/C++ program a signal when a client upload a file.

Is there a script to realize this fonction?

thanks~
yixin is offline   Reply With Quote
Old 07-08-2009, 06:18 AM   #2
o_dog
Senior Member
 
Join Date: May 2007
Posts: 692
Default

write one? What do you mean by signal?
__________________
ioNiNJA
o_dog is offline   Reply With Quote
Old 07-08-2009, 10:18 PM   #3
yixin
Junior Member
 
Join Date: Jul 2009
Posts: 4
Default

Quote:
Originally Posted by o_dog View Post
write one? What do you mean by signal?
About the signal, I dont konw how to say exactly. Genarally, it could be any way that my program on the same PC of the server can konw someone has upload a file without scanning the disk of the FTP server.
yixin is offline   Reply With Quote
Old 07-09-2009, 06:14 AM   #4
o_dog
Senior Member
 
Join Date: May 2007
Posts: 692
Default

like executing the program?
__________________
ioNiNJA
o_dog is offline   Reply With Quote
Old 07-09-2009, 02:09 PM   #5
jeza
Senior Member
ioFTPD Scripter
 
jeza's Avatar
 
Join Date: May 2003
Posts: 530
Default

ioFTPD can execute your program on event OnUploadComplete.
Code:
[Events]
OnUploadComplete = EXEC path\to\your\program.exe
...
in this case ioFTPD will pass next arguments to you program:
Code:
phisical\path\of\the\uploaded\file
CRC32 sum of the file being uploaded
virtual\path\of\the\uploaded\file
jeza is offline   Reply With Quote
Old 07-09-2009, 10:25 PM   #6
yixin
Junior Member
 
Join Date: Jul 2009
Posts: 4
Default

Quote:
Originally Posted by jeza View Post
ioFTPD can execute your program on event OnUploadComplete.
Code:
[Events]
OnUploadComplete = EXEC path\to\your\program.exe
...
in this case ioFTPD will pass next arguments to you program:
Code:
phisical\path\of\the\uploaded\file
CRC32 sum of the file being uploaded
virtual\path\of\the\uploaded\file
This is very useful

P.S. Where can I fine the exact definition of the input arguments? I can'nt find them out in the changelog.txt
yixin is offline   Reply With Quote
Old 07-10-2009, 03:11 AM   #7
jeza
Senior Member
ioFTPD Scripter
 
jeza's Avatar
 
Join Date: May 2003
Posts: 530
Default

i have no idea if there is a manual for that.
i usually use foreach loop trough inputs args, to see what is there.

u have also ioFTPD environmnet variables (PATH, USER, SPEED, ...) available in your program. u can find them in /etc/ folder i think.

just use a method as if u were looking for some WINDOWS ENV variable.

Code:
windows:
Environment.GetEnvironmentVariable("windir");
...

ioFTPD:
Environment.GetEnvironmentVariable("USER"); //username of the user who uploaded the file
Environment.GetEnvironmentVariable("SPEED"); //average speed the file was uplaoded with
...
here is also nice example to start with:
https://oss.azurewebsites.net/forum/showthread.php?t=5992

Last edited by jeza; 07-10-2009 at 03:23 AM.
jeza is offline   Reply With Quote
Reply

Tags
c/c++, ftp, project, server, upload

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:36 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)