You can't actually do both of these at once:
- I'd like to upload directly these files to the file server.
- I'd like to make the file server simple as possible. The file server just serve files.
Under your requirements, the file server needs to both Serves Files and Accepts Uploads of files.
There are a few ways to get the files onto the FileServer
- the easiest way, is just to upload to the AppServer and then have that upload to another server. this is what most AmazonS3 implementations are like.
- if the two machines are on the same LAN , you can mount a volume of the FileServer onto the AppServer using NFS or something similar. Users upload to the AppServer, but the data is saved to a partition that is really on the FileServer.
- You could have a file upload script work on the FileServer. However, you'd need to do a few complex things:
- have a mechanism to authenticate the ability to upload the file. you couldn't just use an authtkt, you'd need to have something that allows one-and-only-one file upload along with some sort of identifier and privilege token. i'd probably opt for an encrypted payload that is timestamped and has the upload permission credentials + an id for the file.
- have a callback on successful upload from the FileServer to the AppServer, letting it know that the id in the payload has been successfully received.