views:

204

answers:

5

I need to create an application "dll, script or exe" which when the user upload on a folder on his server using his ftp, it will automatically run on the current folder and do some image manipulations in the folder images,
My Question is how to make something like this, which the user will not need to configure anything on his server, all what he want is upload in the right folder, and it will run automatically and keep running
Is it possible? How do it? Which Language to use?

UPDATE: I am targeting shared hosting server, which the user have no way to configure his server OS, about the OS, lets start saying its just windows.
I know that "Not possible" may be the right answer, and also "its a virus" may be another answer, i just want to know if its possible or should i think in another new way.

+1  A: 

Hmmm... is this a Window's or Linux machine? If this were on Windows, I would say create a C# service that uses FileSystemWatcher to listen for changes to the FTP folder and do your processing. As a service, it has no user interface and can run automatically on bootup.

CookieOfFortune
A: 

One way I can think of is to use C# directory monitor. So whenever it found out a file is created in the folder it opens it up, checks the file type and executes it if it is an executable. However, you do have to watch out for incomplete file uploads though.

oykuo
A: 

which the user will not need to configure anything on his server

What's the rationale of this requirement?

What's wrong with doing an initial configuration?

What's the target server? Is it linux, window, both?

Please be more specific.

OscarRyz
+4  A: 

Everything I have read in this question screams "security vulnerability exploit". Since it's one of the main things hosting companies are making sure doesn't happen, I would say your chances are very slim to have that work.

However, if it's a web server, with something like CGI or PHP enabled, you could leverage that by uploading a CGI or PHP script in a place it can be run, and then calling it through a browser, thus doing whatever file manipulations you need... Things like safe mode, reserved or virtual directories could get in the way, but I think there is a better chance of that working.

Varkhan
I like the page idea, or i can make it as widget which user can put inside their HTML, and like that it has no problems with security
Amr ElGarhy
+1  A: 

Yes, there is!

http://en.wikipedia.org/wiki/Self_(programming_language)

Daniel Earwicker
seams interesting, but do you think it can help in my problem?
Amr ElGarhy