Is it possible to write a script to find out what ip address was used to upload a file via ftp?
Yes and No! If you open up a folder on your server for others to FTP files to, it is OUTSIDE of PHP. It is handled only by the server. Most all servers keep a log of FTP connections and actions. After a certain amount of time, they just go away. So, on your server, you can check your FTP connection settings and make sure the logging is turned on. Then, you would have to create a CRON job to check the logs and parse thru them to locate the IP tracks of the connections. The CRON job could create a file or add the records into your database. Once you have the tracking data saved somewhere, then you can access it for your uses.
The other alternatives would be to create a posting page and have the users send their files thru that process with would allow you to track their IP’s thru standard PHP commands.
It sound like you want to look at your server’s logging and get the info there. Hope this helps…
Is this any different than checking the access logs?
I’ve searched through the specific day’s log but there’s no line of code that says where a file was uploaded.
Well, it depends on your server. Access logs are not FTP logs. From what I understand, FTP logs are saved as system-wide messages. Therefore, you have to look thru all of the server’s system messages. This can be a hard thing to do without using a program of some sort. There are a lot for sale, but, you can write your own message log reader. Never did this myself, but, could research it for you. In general servers, system messages are stored in “/var/log/messages”… But, can be other places for several if on a shared server.
Not sure if this helps, but, gives you places to look at to start with…