you need to upload the file to a URL accessible location, then execute a script using Insert From URL to import it to the designated record, both of which can be done via CWP.
This old thread debates the options:
Not sure if FmWebFrame is accessible enough to grab the code out of, but it's certainly possible to accomplish.
I may have miss-understood what you are saying, but to store a file into a container in FileMaker Server
1) The container must be stored locally and not as a reference
2) FMS 13 and earlier had a CWP tutorial that showed how to upload files into containers, I don't have a copy of that tutorial on me now otherwise I would post that section of code. The nice thing about using CWP for uploading files is that you can AJAX it and upload the file(s) in the background, and also resize images before uploading, etc..
My mistake, it's been a while since I have done this.